• Resolved sally

    (@sallyruchman)


    Hello Steven,

    I have activated smooth scroll and set smooth scroll offset, but equal what px value I set, the headings appear still underneath the top menu.

    I deactivated also smooth scroll in theme, to not have conflicts.

    Is there a way to manually define the offset somehow to get it work?

    Thx
    Best regards
    Sally

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,
    I am facing the same issue. It is kind of stuck in the content menu. Following.

    • This reply was modified 3 years, 6 months ago by storiesnmore.
    Steven

    (@shazahm1hotmailcom)

    Perhaps there is a fatal javascript eroor that is breaking scripts on your sites. I suggest opening the page in either Chrome or Edge (the new version), hit F12, and click the Console tab. If there are any errors, they could be breaking the ezTOC script which does smooth scrolling.

    I hope this helps!

    Thread Starter sally

    (@sallyruchman)

    Checked, no error in Console

    Best regards
    Sally

    Thread Starter sally

    (@sallyruchman)

    Thanks to Marius from Elegantthemes Support I got it now working for my Divi Theme. If someone else has this issue, please see here the solution:

    Add under Divi – Theme Options – Integration – Header the following Code Snippet, and adapt Header Height Values for Desktop / Mobile Version

    `<script>
    jQuery(function($) {
    window.et_pb_smooth_scroll = function( $target, $top_section, speed, easing ) {
    var $window_width = $( window ).width();
    $menu_offset = -1;

    var headerHeight = 30;
    if ($window_width >= 980) {
    headerHeight = 110;

    }
    if ( $ (‘#wpadminbar’).length) {
    $menu_offset += $( ‘#wpadminbar’ ).outerHeight() + headerHeight – 45 ;
    } else {
    $menu_offset += headerHeight + 5;
    }
    //fix sidenav scroll to top
    if ( $top_section ) {
    $scroll_position = 0;
    } else {
    $scroll_position = $target.offset().top – $menu_offset;
    }
    // set swing (animate’s scrollTop default) as default value
    if( typeof easing === ‘undefined’ ){
    easing = ‘swing’;
    }
    $( ‘html, body’ ).animate( { scrollTop : $scroll_position }, speed, easing );
    }
    });
    </script>

    Best regards
    Sally

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Smooth Scroll Offset not working’ is closed to new replies.