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. Android -- 时间轴(ListView)

    1. 实现效果

  2. 如何更好地学习dubbo源代码(转)

    很荣幸,作为这样一款业界使用率和好评率出众的RPC框架的维护者,今天这个文章主要是想帮助那些热爱开源的同学,更好的来研究dubbo的源代码. 一.Dubbo整体架构 1.Dubbo与Spring的整合 ...

  3. JavaScript获取当前日期,昨天,今天日期以及任意天数间隔日期

    <script language="JavaScript" type="text/javascript"> function GetDateStr( ...

  4. jquery.UI.tabs

    今天对jquery UI的tabs进行了进一步的了解,目的是想把死板的切换效果变得动感点,不过经过这进一步的了解,发现它并不合适或都说并不能实现我想要的效果,我想要的效果就是类似淘宝商城的banner ...

  5. POST在发送数据的时候使用的是HTTP命令

    防止SQL注入 SQL(结构化查询语言)是基于美国国家标准学会(ANSI)标准,并作为共同的语言与数据库通信.每个数据库系统增加了一些专有功能到基本的ANSI SQL. SQL注入是一门将制作好的SQ ...

  6. C++ 画星号图形——空心矩形(核心代码记录)

    int mi=(int)a; int mj=(int)b; ;i<mi;i++) { ;j<mj;j++) { ||i==mi-) cout<<"*"; | ...

  7. Autofac

    程序集准备 Assembly: Autofac/Autofac.Integration.Mvc/System.Web.Mvc/System.Web.Helpers/System.Web.WebPage ...

  8. 在win10里打开.hlp文件

    D7的帮助都是.hlp格式的,  目前win10还没有相应的补丁, 导致无法打开 自己手动来处理一下: 1. 下载连接中的winhlp32.rar, 这个是从XP系统里提取的 2. 修改windows ...

  9. scala中的Actor

    1.介绍 2.简单示例 3.第二个程序 4.通信程序 package day01 import scala.actors.Actor case class Message(content: Strin ...

  10. Xcode清除缓存等

    Xcode出现一些错误的时候,有时候不是代码的问题,需要清理一下Xcode的缓存或者项目的Product等: 1. Product清理 1.1  Product-Clean 1.2  Product- ...