If you like our themes and support, please SHARE our website! https://theme-sky.com/wordpress-themes/

Okay
  Public Ticket #1406744
SMOOTH SCROLLING
Closed

Comments

  • Vlad started the conversation

    Hello. I need smooth scrolling to anchor point (orange button). Why "Back to Top" has smooth scrolling?

  •  567
    Stormit replied

    Hi Vlad,

    You can use javascript to do it. Please read this topic https://stackoverflow.com/questions/7717527/smooth-scrolling-when-clicking-an-anchor-link

    Please note that you may need to change $ to jQuery in the sample code.

    Best regards,

  • Vlad replied

    where i can put this code (for example 

    $('a[href*=#]').click(function(event){    $('html, body').animate({        scrollTop: $( $.attr(this, 'href') ).offset().top    }, 500);    event.preventDefault();
    }); 

    )? in header or body? and how i can do it?

    I may need to change  $ to jQuery so 

    jQuery('a[href*=#]').click(function(event){    $('html, body').animate({        scrollTop: jQuery( jQuery.attr(this, 'href') ).offset().top    }, 500);    event.preventDefault();
    });
  •  567
    Stormit replied

    Hi Vlad,

    You can add it to Theme Options > Custom Code tab > Custom Javascript Code field. 

    Yes, you should change $ to jQuery

    Best regards,

  • Vlad replied

    thenk you so much!))