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滚动条插件,你可以轻松将它们应用在自己的网站中 ...
随机推荐
- HDU5942 : Just a Math Problem
\[\begin{eqnarray*}ans&=&\sum_{i=1}^ng(i)\\&=&\sum_{i=1}^n\sum_{d|i}\mu^2(d)\\&= ...
- Java_类的热替换
转自:http://www.ibm.com/developerworks/cn/java/j-lo-hotswapcls/#ibm-pcon Java ClassLoader 技术剖析 在本文中,我们 ...
- HDU 1166 敌兵布阵 (树状数组)
题目链接 : http://acm.hdu.edu.cn/showproblem.php?pid=1166 敌兵布阵 Time Limit: 2000/1000 MS (Java/Others) ...
- 启动 apache2.4 出现 invalid command order 问题 【由于 PHP 访问权限 403 问题引起】
由于网站出现 403 禁止访问,所以修改了 httpd.conf 文件的权限如下 <Directory /> Options FollowSymLinks AllowOverride N ...
- ssh项目部署到weblogic中问题总结
部署到weblogic还是比较费劲的 ,不过基本上问题全是由于classloader顺序的问题引起的. 首先在web-inf底下添加weblogic.xml文件如下 <?xml version= ...
- ps 文字处理篇
ps文字处理篇 1.对文字镂空处理并且移除到新图像上: 首先创建图层-文字编辑-横排编辑 其次 魔棒工具选择通过颜色来选择选区 右击图层-栅格化图层 删除键将选择的颜色删除留下选区- 复制粘贴到另一个 ...
- Python强化训练笔记(五)——找出多个字典中的公共键
在这个问题中,我们期望得到的结果是找到这三轮比赛中,每轮都进球的球员都有谁.下面用python来模拟一下,先生成一批数据: >>> from random import randin ...
- opengl中对glOrtho()函数的理解
glOrtho是创建一个正交平行的视景体. 一般用于物体不会因为离屏幕的远近而产生大小的变换的情况.比如,常用的工程中的制图等.需要比较精确的显示. 而作为它的对立情况, glFrustum则产生一个 ...
- dynamoDb aws config aws_access_key_id aws_secret_access_key golang
how to set aws_access_key_id awscfg := aws.NewConfig().WithRegion(config.Region).WithCredentials(cr ...
- (转)struts2:数据校验,通过XWork校验框架实现(validation.xml)
转载自:http://www.cnblogs.com/nayitian/p/3475661.html struts2:数据校验,通过XWork校验框架实现(validation.xml) 根据输入 ...