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

Viewing 3 posts - 1 through 3 (of 3 total)
  • #276104
    MKtheory
    Member
    Post count: 4

    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>

    #276118
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    That was caused by the script tags you included. There shouldn’t be any script tags in the custom js field.
    I already changed it. Test again.

    -Rui

    #276121
    David Martin – Support
    Moderator
    Post count: 20834

    Hi,

    Please renew your support license to access the Atelier forums and our support staff.

    How to purchase a support extension: http://www.swiftideas.com/knowledgebase/how-to-purchase-a-support-extension/

    Thanks,
    David.

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