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滚动条插件,你可以轻松将它们应用在自己的网站中 ...
随机推荐
- aps.net cored 新概念
Tag Helpers The EnvironmentTagHelper can be used to include different scripts in your views (for exa ...
- jquery ui dialog autofocus 去掉默认第一个元素获取焦点
经常在dialog窗口中第一个元素为日期控件时,打开窗口则会自动显示日期下拉框. 解决办法:在dialog的open事件中,设置父对象获得焦点. p1_dialog_seniorSearch.dial ...
- 【hihoCoder】1037 : 数字三角形
题目:http://hihocoder.com/problemset/problem/1037 一个迷宫有n层,第 i 层有 i 个房间 从第i层的第i个房间(i, i)可以走到第i+1层的第i个房间 ...
- Canvas实现文字散粒子化
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- 浅谈iOS触摸事件理解
iOS的触摸事件个人总结,分为两步: 第一步:是找到哪个视图上触摸 第二步:分析由谁去响应(响应者连) 1.寻找被触摸的视图原理如下图 hitText:withEvent:的方法处理流程: 首先会在当 ...
- O(n) 筛法求素数
var tot,i,j,k,m,n:longint; prime:array[0..100000] of boolean; p:array[0..100000] of longint;begin re ...
- SqlServer 笔记二 获取汉字的拼音首字母
一.该函数传入字符串,返回数据为:如果为汉字字符,返回该字符的首字母,如果为非汉字字符,则返回本身. 二.用到的知识点:汉字对应的UNICODE值,汉字的排序规则. 三.数据库函数: )) ) AS ...
- x86指令集同频性能提升
x86近5000条指令,迄今为止最复杂的指令集.这里不研究CISC & RISC,也不考虑process制程变化,主要是看最近几代IA架构对于同频率下性能的提升. x86指令集nasm文档 h ...
- C++ string
C++ string best practices => LPTSTR, PSTR, CString, _T, TEXT, Win32 API, Win16. string, wstring. ...
- windows核心编程 - 线程基础
一.基本概念: 一个进程至少需要一个线程. 组成:一个线程包括仅包括一个线程堆栈和一个线程内核对象 线程堆栈:用于维护线程在执行代码时需要的所有函数参数和局部变量 线程内核对象:操作系统用它来对线程实 ...