• Resolved José

    (@guertzen)


    Hi,

    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: https://www.producaocarioca.com

    Thank you.

Viewing 10 replies - 1 through 10 (of 10 total)
  • ditto on the great them.

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

    Thread Starter José

    (@guertzen)

    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

    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.

    Thread Starter José

    (@guertzen)

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

    You can edit this file directly:
    /wp-content/themes/js/fictive.js
    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:

    <?php
    /**
     * 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.

    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.

    Thread Starter José

    (@guertzen)

    Thank you very much CrouchingBruin.

    I′ll try to fix it.
    Not sure if I can, but I′ll try ??

    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).

    Thread Starter José

    (@guertzen)

    Great,

    That way is much more simple ??
    My host have cpanel.

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

    Thank you again.

    Theme Author Automattic

    (@automattic)

    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:
    https://public-api.wordpress.com/rest/v1/themes/download/fictive.zip

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Keep going up on Iphone’ is closed to new replies.