Log in to support

smooth-scroll-link not workin in ATELIER

Landing How can we help? General Feedback & Suggestions smooth-scroll-link not workin in ATELIER

Viewing 3 posts - 1 through 3 (of 3 total)
  • Post count: 4
    June 21, 2016 at 10:50 am #276104

    I can't seem to get a button to smooth scroll to a link on the same page. It worked before but its not working now. I tried pasting the following code but i'm getting all kinds of errors. It just skips instead of sliding... how can i fix this?
    1 Expected an identifier and instead saw '<'.
    1 Expected an assignment or function call and instead saw an expression.
    1 Missing semicolon.
    27 Expected an assignment or function call and instead saw an expression.
    28 Unclosed regular expression.
    28 Unrecoverable syntax error. (100% scanned).

    <script>
    jQuery('li.smooth-scroll-link a').on('click', function(e) {

    var linkHref = jQuery(this).attr('href');

    if (linkHref.indexOf('#') === 0) {
    var spacerHeight = jQuery(linkHref).height(),
    headerHeight = 0;

    if (jQuery('.sticky-header').length > 0) {
    headerHeight = jQuery('.sticky-header').height();
    }
    if (jQuery('#wpadminbar').length > 0) {
    headerHeight = headerHeight + 28;
    }

    jQuery('html, body').stop().animate({
    scrollTop: jQuery(linkHref).offset().top + spacerHeight - headerHeight - 10
    }, 1000, 'easeInOutExpo');

    e.preventDefault();

    } else {
    return e;
    }

    });
    </script>

    Post count: 25779
    June 21, 2016 at 11:02 am #276118

    Replies only viewable for logged in users

    Post count: 20834
    June 21, 2016 at 11:07 am #276121

    Replies only viewable for logged in users

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register