Posted By

mishified on 07/27/17


Tagged

scrolling smooth Unbounce


Versions (?)

Smooth Scrolling


 / Published in: JavaScript
 

Place into before body end tag

  1. <script>
  2. lp.jQuery(function($) {
  3.  
  4. // The speed of the scroll in milliseconds
  5. var speed = 1000;
  6.  
  7. // Find links that are #anchors and scroll to them
  8. $('a[href^=#]')
  9. .not('.lp-pom-form .lp-pom-button')
  10. .unbind('click.smoothScroll')
  11. .bind('click.smoothScroll', function(event) {
  12. event.preventDefault();
  13. $('html, body').animate({ scrollTop: $( $(this).attr('href') ).offset().top }, speed);
  14. });
  15. });
  16. </script>

Report this snippet  

You need to login to post a comment.