Return to Snippet

Revision: 21136
at December 4, 2009 09:22 by LuckyShot


Initial Code
var scrollWin = function (selector) {
	$('html, body').animate({
	scrollTop: $(selector).offset().top
	}, 2000);
}

$("[href^=#]").click(function(e) {
	scrollWin ($(this).attr("href"));
	return false;
});

Initial URL


Initial Description
Detects all anchor links in a page and makes them go to the place smoothly.

Initial Title
jQuery - Smooth anchor scrolling

Initial Tags
jquery

Initial Language
JavaScript