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滚动条插件,你可以轻松将它们应用在自己的网站中 ...
随机推荐
- 【Alpha】Daily Scrum Meeting第四次
之前没领悟到Daily Scrum Meeting的精髓,认为要做出些东西才敢拿出来. 在范老师提醒我们保持有节奏的迭代后,我们意识到之前的想法是不符合Daily Scrum Meeting的思想的. ...
- 浮点数 (IEEE-754)
浮点数又称"实数",一个浮点数包含三个部分 符号位(S) 阶码 有效数字 S:阶码:有效数字 浮点数是由科学二级制来表示的. 三种类型的浮点数: 短浮点数(32bit): S(b ...
- ComboSelect 下拉筛选
Jquery Combo Select下拉筛选 http://www.dowebok.com/179.html
- 腾讯QQ认证空间4月27日已全面开放申请,欲进军自媒体
今天看到卢松松的博客上爆出,腾讯QQ认证空间4月27日已全面开放申请的消息,这一消息出来, 马浩周根据提示方法进行申请,下面先说说腾讯QQ认证空间的申请方法: QQ认证空间开放申请公告地址:http: ...
- poj3740
#include<stdio.h>#include<iostream>int map[16][300];int vistx[16];int visty[300];int zhe ...
- android 存储图片到data目录和读取data目录下的图片
, fos); } ); Bitmap.CompressFormat localCompressFormat = Bitmap.CompressFormat.PNG; bitmap.compress( ...
- Python 开平方
#!/user/bin/python3#files :using_sys.pyf = open("filename.txt","r+")num = f.read ...
- Unity WebGL MoonSharp崩溃问题
当前Unity的代码更新方案基本都选择的ULua,而我们项目还需要考虑Web平台,ULua不支持WebGL,所以决定选择MoonSharp.MoonSharp(http://www.moonsharp ...
- 转: CentOS安装jdk8
from: http://tecadmin.net/install-java-8-on-centos-rhel-and-fedora/ After a long wait, finally Java ...
- selenium RC+JAVA 运行所遇到的问题
1.报错一 Failed to start new browser session: java.lang.RuntimeException: Firefox 3 could not be found ...