ScrollSpy is a small but power
ScrollSpy
ScrollSpy is a small but powerful MooTools plugin that allows you to listen to scrolling within any DOM element and execute functions based upon the element's scroll position.
ScrollSpy can be initialized at any time but is generally initialized at the top of the document during the page's normal load. There are no required arguments -- only options.
#JS
/* my "Go To Top" link element */
var link = document.id('gototop');
/* scrollspy instance */
var ss = new ScrollSpy({
min: 300,
onEnter: function() {
link.fade('in'); //show the "Go To Top" link
},
onLeave: function() {
link.fade('out'); //hide the "Go To Top" link
}
});
For specific usage and options, please read the documentation or visit http://davidwalsh.name/js/scrollspy
版权声明:
1、该文章(资料)来源于互联网公开信息,我方只是对该内容做点评,所分享的下载地址为原作者公开地址。2、网站不提供资料下载,如需下载请到原作者页面进行下载。