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. 怎样去除织梦版权信息中的Power by DedeCms

    用织梦建站时,网站底部调用的版权信息最后总会多出一个Power by DedeCms链接,此链接是织梦系统中默认的指向织梦官网的外链.本文就介绍两种去除这个外链的方法. 1.为什么要去除Power b ...

  2. ActiveMQ集群应用

    ActiveMQ集群 ActiveMQ具有强大和灵活的集群功能,但在使用的过程中会发现很多的缺点,ActiveMQ的集群方式主要由两种:Master-Slave和Broker Cluster. 1.M ...

  3. Android端接收和发送cookie

    流程: 首先android端使用HttpClient的方式发送HTTP请求,此时服务器创立cookie,并发送cookie给android端,android端再将cookie保存起来,在需要发送coo ...

  4. *HDU 1086 计算几何

    You can Solve a Geometry Problem too Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/3 ...

  5. jquery autocomplete插件

    jquery autocomplete插件 https://goodies.pixabay.com/jquery/auto-complete/demo.html autocomplete-table ...

  6. 阿里云服务器Linux CentOS安装配置(零)目录

    阿里云服务器Linux CentOS安装配置(零)目录 阿里云服务器Linux CentOS安装配置(一)购买阿里云服务器 阿里云服务器Linux CentOS安装配置(二)yum安装svn 阿里云服 ...

  7. SQL IN 操作符、SQL BETWEEN 操作符、SQL Alias(别名)

    IN 操作符 IN 操作符允许我们在 WHERE 子句中规定多个值. SQL IN 语法 SELECT column_name(s) FROM table_name WHERE column_name ...

  8. AJAX的封装(包括跨域问题)

    注意: 1.同域下支持get和post方法 2.跨域问题必须得到后台的支持 3.跨域只支持get方法 function AJAX(obj){ //做网络请求的时候,参数以"对象"的 ...

  9. WordPress忘记登录密码

    后台的登录密码使用的是md5加密的,有时候会忘记登录密码,那么可以修改数据库,把密码改为你知道的字符串的md5加密值 如 hello对应的md5加密值为:5d41402abc4b2a76b9719d9 ...

  10. web api与webservice(转)

    webservice走HTTP协议和80端口而你说的api,用的协议和端口,是根据开发人员定义的 这么说吧,api类似于cs架构,需要同时开发客户端API和服务器端程序而WebService则类似于b ...