We Recommend

Pro JavaScript Techniques Pro JavaScript Techniques
Pro JavaScript Techniques is the ultimate JavaScript book for the modern web developer. It provides everything you need to know about modern JavaScript, and shows what JavaScript can do for your web sites. This book doesn't waste any time looking at things you already know, like basic syntax and structures.


Posted By

madmanlear on 04/24/08


Tagged

jquery interface


Versions (?)


Who likes this?

8 people have marked this snippet as a favorite

luman
orhanveli
martingoldszein
blackabee
korzhik
orion
esquareda
maniesco


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.