/ Published in: JavaScript
Detects all anchor links in a page and makes them go to the place smoothly.
Expand |
Embed | Plain Text
var scrollWin = function (selector) { $('html, body').animate({ scrollTop: $(selector).offset().top }, 2000); } $("[href^=#]").click(function(e) { scrollWin ($(this).attr("href")); return false; });
You need to login to post a comment.
