jQuery Plugin - Scroll to Top

Config

defaults = {
	duration : 300,					// scroll duration
	is_fixed : true,				// if false, all params below will be ignored
	top_blank : 100,				// max height from top
	is_scrollstop : true,				// use scroll stop event or not
	scrollstop_latency : 300,			// latency for scroll stop event
	btm_position : 100				// for absolute position, valid for IE6-
}
		

Source

jquery-scrolltotop.js
jquery-scrolltotop.min.js

HTML

<a id="back-to-top-fixed" class="back-to-top-fixed" href="#">Top(Fixed)</a>
<a class="back-to-top-normal" href="#">Top(Normal)</a>
		

Script

<script type="text/javascript" src="http://www.swordair.com/js/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="http://www.swordair.com/js/plugins/jquery-scrolltotop.min.js"></script>
<script type="text/javascript">
	$('#back-to-top-fixed').scrollToTop();
	$('.back-to-top-normal').scrollToTop({is_fixed:false});
</script>
		

Compatibility

IE6+, and all modern browser





















Top(Normal)



















Top(Normal)



















Top(Normal)



















End of Demo Page

Top(Fixed)