简单的jQuery无缝向上滚动效果
简介
这是一个基于 jQuery 的简单的向上滚动效果插件,代码很少,功能也比较单一,可用于文字或图片滚动,鼠标移动到上面会暂停滚动。功能虽然单一,不过一般情况下也够用了,而且还很小巧。
在线演示及下载
兼容
兼容所有浏览器,包括 IE6。
使用方法
1、引入文件
2、HTML
- bootstrap特效对照手册111
- bootstrap特效对照手册222
- bootstrap特效对照手册111
- bootstrap特效对照手册222
- bootstrap特效对照手册111
- bootstrap特效对照手册222
- bootstrap特效对照手册111
- bootstrap特效对照手册222
- bootstrap特效对照手册111
- bootstrap特效对照手册222
- bootstrap特效对照手册111
- bootstrap特效对照手册222
- bootstrap特效对照手册111
- bootstrap特效对照手册222
- bootstrap特效对照手册111
- bootstrap特效对照手册222
- bootstrap特效对照手册111
- bootstrap特效对照手册222
3、CSS
* { margin: 0; padding: 0; } .myscroll { width: 300px; height: 260px; margin: 0 auto; border: 1px solid #ccc; line-height: 26px; font-size: 12px; overflow: hidden; } .myscroll li { height: 26px; margin-left: 25px; } .myscroll a { color: #333; text-decoration: none; } .myscroll a:hover { color: #ED5565; text-decoration: underline; }
4、JavaScript
$(function(){ $('.myscroll').myScroll({ speed: 40, //数值越大,速度越慢 rowHeight: 26 //li的高度 }); });
注意:rowHeight 的值必须和 li 的高度(包括 margin、padding、border)一致,否则会出现卡顿的现象。
参数
参数 | 类型 | 说明 | 默认值 |
---|---|---|---|
speed | 数字 | 滚动速度,值越大速度越慢 | 40 |
rowHeight | 数字 | 每行的高度,单位为 px | 24 |