jQuery Scroll Follow
Overview
Scroll Follow is a simple jQuery plugin that enables a DOM object to follow the page as the user scrolls. Scroll Follow has been successfully tested on IE6, IE7, FF2, FF3, Safari 3, and Opera 9 on Windows. It has been successfully tested on FF3 and Safari 3 on MacOSX.
Requirements
- jQuery (tested with 1.2.6)
- jQuery UI Core (tested with 1.5.2)
Optional
Installation
- Include jQuery:
- <script type="text/javascript" src="jquery.js"></script>
<!-- end .code-->
- Include required plugins, including Scroll Follow:
- <script type="text/javascript" src="ui.core.js"></script>
- <script type="text/javascript" src="jquery.scrollFollow.js"></script>
<!-- end .code-->
- Call Scroll Follow on the desired DOM object:
View Example- <script type="text/javascript">
- $( '#example' ).scrollFollow();
- </script>
<!-- end .code-->
- Or call Scroll Follow on the desired DOM object and give it some parameters:
View Example- <script type="text/javascript">
- $( document ).ready( function () {
- $( '#example' ).scrollFollow( {
- speed: 1000,
- offset: 60,
- killSwitch: 'exampleLink',
- onText: 'Disable Follow',
- offText: 'Enable Follow'
- } );
- } );
- </script>
<!-- end .code-->
- The Scroll Follow object will remain inside its immediate container.
View Example - Or you can specify a parent (by ID) for the Scroll Follow object to consider its container:
View Example- <script type="text/javascript">
- $( document ).ready( function () {
- $( '#example' ).scrollFollow( {
- container: 'outer'
- } );
- } );
- </script>
<!-- end .code-->
- Scroll Follow uses the "top" property of an object to slide it. Therefore, the "position" of the object must be set to either "relative" or "absolute." Other than that limitation, the Scroll Follow object should be completely configured through CSS.
Parameters
• speedint - default: 500
The duration of the sliding animation (in milliseconds). The smaller the value, the faster the animation.• easingstring - default: 'linear'
If included, use any one of the easing options from the easing plugin . Uses 'linear' by default which provides no easing.• offsetint - default: 0
Number of pixels the Scroll Follow object should remain from top of viewport.• containerstring - default: object's immediate parent
ID of the containing div.• killSwitchstring - default: 'killSwitch'
ID of the On/Off toggle element. Requires the jQuery Cookie plugin .• onTextstring - default: 'Turn Slide Off'
killSwitch text to be displayed if sliding is enabled.• offTextstring - default: 'Turn Slide On'
killSwitch text to be displayed if sliding is disabled.• relativeTostring - default: 'top'
Scroll animation can be relative to either the 'top' or 'bottom' of the viewport.• delayint - default: 0
Time between the end of the scroll and the beginning of the animation in milliseconds.
jQuery Scroll Follow的更多相关文章
- jQuery Scroll Path 滚插视图酷炫
jQuery Scroll Path是一个jQuery的滚动路径插件,可以让你自定义滚动路径.该插件是使用canvas flavored的语法来绘制路径.可以通过鼠标滚轮上/下箭头键和空格键来查看路径 ...
- jQuery scroll事件实现监控滚动条分页示例(转)
这篇文章主要介绍了jQuery scroll事件实现监控滚动条分页简单示例,使用ajax加载,同时介绍了(document).height()与$(window).height()的区别,需要的朋友可 ...
- jquery scroll()方法 语法
jquery scroll()方法 语法 作用:当用户滚动指定的元素时,会发生 scroll 事件.scroll 事件适用于所有可滚动的元素和 window 对象(浏览器窗口).scroll() 方法 ...
- jQuery scroll(滚动)延迟加载
延迟加载 $(window).scroll(function(){ var scrollHeight = $(document).height(); //文档高度 var scrollTop = $( ...
- jquery scroll()滚动条事件
最近做项目用了到scroll滚动条事件,花了很多时间做搜索,没有很好的先整理思考后再去搜索,做编码事件时,没有事先考虑清楚,理清思路,先做简单的测试成功后,再完成其他的实现. 1.scroll()事件 ...
- 扩展jquery scroll事件,支持 scroll start 和 scroll stop
效果预览: github: https://besswang.github.io/webapp-scroll/ 参考地址: http://www.ghugo.com/special-scroll-ev ...
- jQuery scroll事件
scroll事件适用于window对象,但也可滚动iframe框架与CSS overflow属性设置为scroll的元素. $(document).ready(function () { //本人习惯 ...
- jQuery Scroll div滚动条样式更改
<script type="text/javascript" src="js/jquery-1.2.6.min.js"></script> ...
- 11 个最佳 jQuery 滚动条插件
通过jQuery滚动条插件,你可以换掉千篇一律的默认浏览器滚动条,让你的网站或web项目更具特色,更有吸引力.本文收集了11款非常漂亮.实用的jQuery滚动条插件,你可以轻松将它们应用在自己的网站中 ...
随机推荐
- 【转】HashMap、TreeMap、Hashtable、HashSet和ConcurrentHashMap区别
转自:http://blog.csdn.net/paincupid/article/details/47746341 一.HashMap和TreeMap区别 1.HashMap是基于散列表实现的,时间 ...
- 未能添加对***.dll的引用问题
在机器A上运行.编译成功的程序,在B上不能正确被编译,并且添加r如 knbook.dll 时候提示如下: 未能添加对"knbook.dll"引用,请确保此文件可以访问并且是一个有效 ...
- 自己写的AutoMapper
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using Sy ...
- angularJS学习资源最全汇总
基础 官方: http://docs.angularjs.org angularjs官方网站已被墙,可看 http://www.ngnice.com/: 官方zip下载包 https://github ...
- word2013删除下载的模板
word2013删除下载的模板 删除步骤: 1)关闭相关的word文档. 2)按照以下的路径找到相应的位置:"%系统根目录%\Users\Administrator\AppData\Roam ...
- ZeroMQ接口函数之 :zmq_ctx_set - 设置环境上下文属性
ZeroMQ 官方地址 :http://api.zeromq.org/4-0:zmq_ctx_set zmq_ctx_set(3) ØMQ Manual - ØMQ/3.2.5 Name zmq_ct ...
- Ubuntu 14.04 安装pdf阅读器
1. 个人推荐 okular. 关于安装okular的原因,可以很好的做到护眼功能. Ubuntu 14.04 自带的阅读器,因为白色太刺眼,长时间使用对眼睛不好. 对于,长时间编程的朋友们习惯夜间模 ...
- ArcMap 10.3 AddIN找不到插件
现象:VS 2012写的AddIn插件,编译通过,安装成功 ArcGIS 10.3的AddIN Manager中,可以看到该插件 可是在自定义中却找不到.检索不到该插件. 解决方法:.net Fram ...
- 关于web.config中<customErrors>节点说明
<customErrors>节点用于定义一些自定义错误信息的信息.此节点有Mode和defaultRedirect两个属性,其中defaultRedirect属性是一个可选属性,表示应用程 ...
- bzoj2523 聪明的学生
bzoj第一题,ctsc2001. 黑书上的递归例题,我们定义time()函数,递归求解即可. 这个题用到了一个小技巧:可以使用枚举来搞算法. #include <iostream> #i ...