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

Optional

Installation

  1. Include jQuery:

    1. <script type="text/javascript" src="jquery.js"></script>

    <!-- end .code-->

  2. Include required plugins, including Scroll Follow:
    1. <script type="text/javascript" src="ui.core.js"></script>
    2. <script type="text/javascript" src="jquery.scrollFollow.js"></script>

    <!-- end .code-->

  3. Call Scroll Follow on the desired DOM object: 
    View Example
    1. <script type="text/javascript">
    2. $( '#example' ).scrollFollow();
    3. </script>

    <!-- end .code-->

  4. Or call Scroll Follow on the desired DOM object and give it some parameters: 
    View Example
    1. <script type="text/javascript">
    2. $( document ).ready( function () {
    3. $( '#example' ).scrollFollow( {
    4. speed: 1000,
    5. offset: 60,
    6. killSwitch: 'exampleLink',
    7. onText: 'Disable Follow',
    8. offText: 'Enable Follow'
    9. } );
    10. } );
    11. </script>

    <!-- end .code-->

  5. The Scroll Follow object will remain inside its immediate container. 
    View Example
  6. Or you can specify a parent (by ID) for the Scroll Follow object to consider its container: 
    View Example
    1. <script type="text/javascript">
    2. $( document ).ready( function () {
    3. $( '#example' ).scrollFollow( {
    4. container: 'outer'
    5. } );
    6. } );
    7. </script>

    <!-- end .code-->

  7. 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的更多相关文章

  1. jQuery Scroll Path 滚插视图酷炫

    jQuery Scroll Path是一个jQuery的滚动路径插件,可以让你自定义滚动路径.该插件是使用canvas flavored的语法来绘制路径.可以通过鼠标滚轮上/下箭头键和空格键来查看路径 ...

  2. jQuery scroll事件实现监控滚动条分页示例(转)

    这篇文章主要介绍了jQuery scroll事件实现监控滚动条分页简单示例,使用ajax加载,同时介绍了(document).height()与$(window).height()的区别,需要的朋友可 ...

  3. jquery scroll()方法 语法

    jquery scroll()方法 语法 作用:当用户滚动指定的元素时,会发生 scroll 事件.scroll 事件适用于所有可滚动的元素和 window 对象(浏览器窗口).scroll() 方法 ...

  4. jQuery scroll(滚动)延迟加载

    延迟加载 $(window).scroll(function(){ var scrollHeight = $(document).height(); //文档高度 var scrollTop = $( ...

  5. jquery scroll()滚动条事件

    最近做项目用了到scroll滚动条事件,花了很多时间做搜索,没有很好的先整理思考后再去搜索,做编码事件时,没有事先考虑清楚,理清思路,先做简单的测试成功后,再完成其他的实现. 1.scroll()事件 ...

  6. 扩展jquery scroll事件,支持 scroll start 和 scroll stop

    效果预览: github: https://besswang.github.io/webapp-scroll/ 参考地址: http://www.ghugo.com/special-scroll-ev ...

  7. jQuery scroll事件

    scroll事件适用于window对象,但也可滚动iframe框架与CSS overflow属性设置为scroll的元素. $(document).ready(function () { //本人习惯 ...

  8. jQuery Scroll div滚动条样式更改

    <script type="text/javascript" src="js/jquery-1.2.6.min.js"></script> ...

  9. 11 个最佳 jQuery 滚动条插件

    通过jQuery滚动条插件,你可以换掉千篇一律的默认浏览器滚动条,让你的网站或web项目更具特色,更有吸引力.本文收集了11款非常漂亮.实用的jQuery滚动条插件,你可以轻松将它们应用在自己的网站中 ...

随机推荐

  1. 【BZOJ】3737: [Pa2013]Euler

    题意: 求满足\(phi(a)=n\)的\(a\)的个数.(\(n \le 10^{10}\)) 分析 这种题一开始就感觉是搜索= = 题解 首先容易得到 \[\phi(n) = \prod_{i} ...

  2. CSS笔记1

    一. 列表 列表是有三种形式 1.1   无序列表 无序列表,用来表示一个列表语义,并且每个项目与项目之间是不分先后顺序的 ul 的英文unordered list "无序列表" ...

  3. ZeroMQ接口函数之 :zmq_msg_set - 设置消息的性质

    ZeroMQ 官方地址 :http://api.zeromq.org/4-1:zmq_msg_set zmq_msg_set(3)  ØMQ Manual - ØMQ/3.2.5 Name zmq_m ...

  4. ejabberd 在eclipse(erlide)中的配置、调试、运行

    最近在折腾ejabberd,将ejabberd项目配置到eclipse中进行编译.调试等,现在将过程记下来,希望能帮助到需要的人. 准备 本次环境是在linux中进行,博主的linux是fedora2 ...

  5. cookie小析

    cookie用于存储数据,当用户访问了某个网站(网页)时,我们就可以通过cookie来向访问者电脑上存储数据1.不同的浏览器存放的cookie位置不同,也不能通用2.cookie的存储是以域名的形式进 ...

  6. Winform TextBox中只能输入数字的几种常用方法(C#)

    方法一: private void tBox_KeyPress(object sender, KeyPressEventArgs e) { ; //禁止空格键 )) return; //处理负数 if ...

  7. vmstat命令学习

    vmstat 是Linux/Unix系统用来进行系统监控的工具 监控的目标主要有目标服务器的cpu使用率.内存的使用情况.虚拟内存交换情况,IO读写情况. 可以通过vmstat --help来获得该命 ...

  8. HDU 5833 Zhu and 772002(高斯消元)

    题意:给n个数,从n个数中抽取x(x>=1)个数,这x个数相乘为完全平方数,求一共有多少种取法,结果模1000000007. 思路:每个数可以拆成素数相乘的形式,例如: x1 2=2^1 * 3 ...

  9. win7下wndows virtual pc 2007 装xp比新版本的 Windows virtual pc 好用

    2007下装xp虚拟机启动快,支持拖放.

  10. 运行JSP时出现The requested resource (/proj3/MyJsp.jsp) is not available.(亲测有用)

    网上回答一波一波,坑爹也是一波一波,自己尝试了好多方法,大家都知道路径有错但是都不知道自己路径错在哪里,所以那些回答等于废话一堆,无意用里面写好index.jsp测试发现了这个问题.少说废话直接上图测 ...