[resolved] Keep going up on Iphone (11 posts)

  1. José
    Posted 1 year ago #


    First of all, congratulation for the great work.

    Everything is working fine, but when I enter in my wp using my iphone, the site keep going up, and I have to scroll down again several times.

    How can I fix that.

    my site: http://www.producaocarioca.com

    Thank you.

  2. sphericalphil
    Posted 1 year ago #

    ditto on the great them.

    We are having the same issue with Android (testing on a Samsung G4)

  3. José
    Posted 1 year ago #

    I just realize that this problem only occur in Chrome. When I use Safari, everything is fine. Any idea in how we can fix that?

    Than you

  4. CrouchingBruin
    Posted 1 year ago #

    There's some jQuery/JavaScript that gets executed when the site loads or resizes, which scrolls the site down past the header image if the screen width is less than 820px. Not very conventional, IMO. Don't know why Safari doesn't display the behavior, but it is trying to something, because if I change the orientation of my iPhone, the page automatically scrolls up to the very top, which is very annoying. It should just stay at the same place where I was reading.

    Unfortunately, it's not straight-forward to override. You can edit the fictive.js file to remove that part of the code, and that is actually fairly easy if you understand JavaScript. But your modification will be overwritten when the theme is upgraded in the future.

    This "feature" needs to be removed from future upgrades of the theme.

  5. José
    Posted 1 year ago #

    Can you explain to us how to do it?
    Which file, and which line we have to remove?
    I´ll really appreciate that. :)

  6. CrouchingBruin
    Posted 1 year ago #

    You can edit this file directly:
    But the correct way to do it is to first create a child theme with a style.css file that imports the parent stylesheet.

    After you've created your child theme's style.css file, create a folder called js within your child theme's folder. The js folder will be used to hold a modified version of fictive.js.

    Download fictive.js from the parent folder, and make the following changes. Right around line 20, change this:

    //Scroll past header image on screen widths less than 820px
    	$.fn.scrollDown = function() {
    		$( 'body,html' ).animate( {
    			scrollTop: $scrollPosition
    		}, 400 );

    to this:

    //Scroll past header image on screen widths less than 820px
    	$.fn.scrollDown = function() {
    //		$( 'body,html' ).animate( {
    //			scrollTop: $scrollPosition
    //		}, 400 );

    All you are doing is commenting out three lines starting at line 22 by putting double slashes at the beginning.

    Upload your modified fictive.js file to your child theme's js folder.

    Then create a functions.php file that has this in it:

     * Fictive child theme functions and definitions
    function fictive_child_scripts() {
        wp_register_script( 'fictive-script', get_stylesheet_directory_uri() . '/js/fictive.js', array( 'jquery' ), '20140403', true );
        wp_enqueue_script( 'fictive-script');
    add_action( 'wp_enqueue_scripts', 'fictive_child_scripts' );

    Upload this into your child theme's folder. What this will do is prevent the parent theme's fictive.js script from loading, and will load instead your modified fictive.js file from your child theme's js folder.

    That should do it, the child theme will no longer scroll to a position below the header image on screen resize.

  7. Thanks for the reports and special thanks to CrouchingBruin for pointing out the probable cause - and a fix - for the issue.

    I'm passing everything along to our developers so they can implement a fix in the next version of the theme.

  8. José
    Posted 1 year ago #

    Thank you very much CrouchingBruin.

    I´ll try to fix it.
    Not sure if I can, but I´ll try :)

  9. CrouchingBruin
    Posted 1 year ago #

    Jose, if the plan is to implement a fix in the next version of the theme, then you can forgo the creation of a child theme and edit the file directly. You will need to FTP the file down to your computer, edit it in a text editor, rename the original file on the server to some back-up name for safekeeping, then upload your modified file back into the original folder. Or, if your host has some sort of control panel that allows you to edit files directly on the server, you can do it that way (make a copy of the file first, though).

  10. José
    Posted 1 year ago #


    That way is much more simple :)
    My host have cpanel.

    edit: [already done. its working like a charm]

    Thank you again.

  11. Automattic
    Theme Author

    Posted 1 year ago #

    Howdy! We've released a fix for this; you can download the latest version here while we're waiting for it to be updated on WP.org:

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic