On Click button scroll to section

wp nav menu2
<div class="btnWrapper">
  <a href="#" class="button">Scroll Up</a>
</div>
<div class="section">Lorem Ipsum</div>
jQuery(".button").click(function() {
    jQuery('html,body').animate({
        scrollTop: jQuery(".section").offset().top},
        'slow');
});

Leave a Reply