Jquery Smotth Scroll to Anchor Links


 / Published in: JavaScript
 

Smooth scroll to anchor links, requires Interface plugin

  1. $.fn.scroller = function() {
  2. var speed = 'slow'; // Choose default speed
  3. $(this).each(function() {
  4. $(this).bind('click', function() {
  5. var target = $(this).attr('href'); // Get scroll target
  6. $(target).ScrollTo(speed);
  7. return false;
  8. });
  9. });
  10. }

Report this snippet  

You need to login to post a comment.