• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

sxalexander/jquery-scrollspy: A JQuery Implementation of David Walsh's MooT ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

sxalexander/jquery-scrollspy

开源软件地址:

https://github.com/sxalexander/jquery-scrollspy

开源编程语言:


开源软件介绍:

jquery-scrollspy

This library is no longer actively supported or maintained.

For similar functionality checkout these other libraries:

--

An adaptation of the Mootools Scrollspy ( http://davidwalsh.name/mootools-scrollspy ) plugin for jQuery

(c) 2011 Samuel Alexander ([email protected])

Released under The MIT License.

Description:

scrollspy is a simple jQuery plugin for firing events based on where the user has scrolled to in a page.

Homepage:

http://github.com/sxalexander/jquery-scrollspy

Source:

Hosted at GitHub; browse at:

http://github.com/sxalexander/jquery-scrollspy/tree/master

Or clone from:

git://github.com/sxalexander/jquery-scrollspy.git

Usage:

  1. Insert the necessary elements in your document's <head> section, e.g.:

     <script type='text/javascript' src='/javascripts/jquery.scrollspy.js'></script>
    

Remember to include jquery.scrollspy.js after including the main jQuery library.

  1. Initialise scrollspy in your document.onload, e.g.:

     <script type='text/javascript'>
         $(document).ready(function() {
     			$('#sticky-navigation').scrollspy({
     				min: $('#nav').offset().top,
     				onEnter: function(element, position) {
     					$("#nav").addClass('fixed');
     				},
     				onLeave: function(element, position) {
     					$("#nav").removeClass('fixed');
     				}
     			});
     		});
     </script>
    

Check out the /examples for more info !

Documentation:

Options for ScrollSpy include:

min: (defaults to 0) The minimum value of the X or Y coordinate, depending on mode.
max: (defaults to 0) The maximum value of the X or Y coordinate, depending on mode.
mode: (defaults to 'vertical') Defines whether to listen to X or Y scrolling.
container: (defaults to window) The element whose scrolling to listen to.

Events for ScrollSpy include:

scrollTick: Fires on each scroll event within the min and max parameters. Receives as parameters:

    position: an object with the current X and Y position.
    inside: a Boolean value for whether or not the user is within the min and max parameters
    enters: the number of times the min / max has been entered.
    leaves: the number of times the min / max has been left.

scrollEnter: Fires every time the user enters the min / max zone.
        position: an object with the current X and Y position.
        enters: the number of times the min / max has been entered.

scrollLeave: Fires every time the user leaves the min / max zone.
        position: an object with the current X and Y position.
        leaves: the number of times the min / max has been left.

A note on forking:

By forking this project you hereby grant permission for any commits to your fork to be merged back into this repository and, with attribution, be released under the terms of the MIT License.

Contributors




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap