Okay
  Public Ticket #1102288
Smooth Scroll Java Script for link not working.
Closed

Comments

  • Aria started the conversation

    Hi there, I'm using Unite Revolution Slider 2 on Joomla version
    3.6.5.  I have a button that I have set an "image link" to.  The link
    is for an anchor on the same page which is #about.

    I would like the page to smooth scroll to the about section when this
    button is pressed, but at the moment it just jumps to that section
    instantly.

    I have entered the Custom JavaScript that you have listed on here; https://www.themepunch.com/faq/smooth-scroll-to-other-page-content-5-0/

    i.e.

    jQuery('body').on('click', 'a.tp-caption', function() {
     
        var $this = jQuery(this),
        href = $this.attr('href');
     
        if(!href || href.charAt(0) !== '#') return;
        var el = jQuery(href);
     
        if(!el.length) el = jQuery('a[name=' + href.substring(1, href.length) + ']');
        if(!el.length) return;
     
        jQuery('html, body').animate({scrollTop: el.offset().top}, 1000);
        return false;
     
    });

    However, this does not seem to make any difference and the buttons behaviour has not changed.

    Please can you kindly advise?  Thank you.

  •  528
    Igor replied

    Hi,

    JS provided on that page is working with the Revolution slider v5 and you are using v4

    Regards,
    Igor

  • Aria replied

    Ok, Please can I kindly have the JS that would carry out the same function for v4?

  •   Max replied privately