Jquery Smotth Scroll to Anchor Links


/ Published in: JavaScript
Save to your folder(s)

Smooth scroll to anchor links, requires Interface plugin


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.