jQueryTools-Scrollable.js
转载一篇例子,学习使用;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script
src="http://cdn.jquerytools.org/1.0.2/jquery.tools.min.js"></script>
<script src="http://static.flowplayer.org/js/jquery.mousewheel.js"
></script>
<link rel="stylesheet" type="text/css"
href="http://static.flowplayer.org/tools/css/scrollable-navig.css" />
<style><!--
div.scrollable {
position:relative;
overflow:hidden;
width: 646px;
height:300px;
}
#thumbs {
position:absolute;
width:20000em;
clear:both;
border:1px solid
#222;
}
a.prev, a.next {
margin-top:118px;
}
#thumbs
div {
float:left;
width:214px;
height:300px;
background:#333
url(/upload/20090906120115441.png) repeat-x 0 146px;
color:#fff;
border-left:1px solid #333;
cursor:pointer;
}
#thumbs
div.hover {
background-color:#444;
}
#thumbs div.active {
background-color:#066;
cursor:default;
}
#thumbs h3, #thumbs
p, #thumbs span {
margin:13px;
font-family:"bitstream vera sans";
font-size:13px;
color:#fff;
}
#thumbs h3 em {
font-style:normal;
color:yellow;
}
--></style><style>div.scrollable {
position:relative;
overflow:hidden;
width: 646px;
height:300px;
}
#thumbs {
position:absolute;
width:20000em;
clear:both;
border:1px solid
#222;
}
a.prev, a.next {
margin-top:118px;
}
#thumbs
div {
float:left;
width:214px;
height:300px;
background:#333
url(/upload/20090906120115441.png) repeat-x 0 146px;
color:#fff;
border-left:1px solid #333;
cursor:pointer;
}
#thumbs
div.hover {
background-color:#444;
}
#thumbs div.active {
background-color:#066;
cursor:default;
}
#thumbs h3, #thumbs
p, #thumbs span {
margin:13px;
font-family:"bitstream vera sans";
font-size:13px;
color:#fff;
}
#thumbs h3 em {
font-style:normal;
color:yellow;
}</style>
<!-- navigator -->
<div
class="navi"></div>
<!-- prev link -->
<a
class="prev"></a>
<!-- root element for scrollable -->
<div class="scrollable">
<div id="thumbs">
<div>
<img src="/upload/20090906120116994.jpg"
/>
<h3><em>1. </em>An example title</h3>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Proin et felis eget
tellus pharetra porttitor. Praesent dui arcu, egestas
quis, adipiscing a.
</p>
<span class="blue">60
sec</span>
</div>
<div>
<img
src="/upload/20090906120117587.jpg" />
<h3><em>2.
</em>An example title</h3>
<p>
Lorem ipsum dolor
sit amet, consectetur adipiscing elit. Proin et felis eget
tellus pharetra
porttitor. Praesent dui arcu, egestas quis, adipiscing a.
</p>
<span class="blue">80 sec</span>
</div>
<div>
<img src="/upload/20090906120117884.jpg" />
<h3><em>3. </em>An example title</h3>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Proin et felis eget
tellus pharetra porttitor. Praesent dui arcu, egestas
quis, adipiscing a.
</p>
<span class="blue">100
sec</span>
</div>
<div>
<img
src="/upload/20090906120117490.jpg" />
<h3><em>4.
</em>An example title</h3>
<p>
Lorem ipsum dolor
sit amet, consectetur adipiscing elit. Proin et felis eget
tellus pharetra
porttitor. Praesent dui arcu, egestas quis, adipiscing a.
</p>
<span class="blue">120 sec</span>
</div>
<div>
<img src="/upload/20090906120118968.jpg" />
<h3><em>5. </em>An example title</h3>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Proin et felis eget
tellus pharetra porttitor. Praesent dui arcu, egestas
quis, adipiscing a.
</p>
<span class="blue">140
sec</span>
</div>
</div>
</div>
<!-- next link -->
<a class="next"></a>
<!-- let rest of the page float normally -->
<br
clear="all" />
<div>
<input type="button" value="remove"
id="remove"/>
</div>
<script
type="text/javascript"><!--
$(function() {
$("div.scrollable").scrollable({
size: 3,
vertical:false,
//clickable:false,
loop:true,//设置是否自动跳转(根据间隔时间)
//interval:
1000,//设置间歇时间间隔
//speed:2000,
items: '#thumbs',
//prev:'.prev',//跳转到上一项
//next:'.next'//跳转到下一项
prevPage:'.prev',//跳转到上一页
nextPage:'.next',//跳转到下一页
hoverClass:
'hover',
easing:'linear'
});
var
scrollable=$("div.scrollable").scrollable();
//alert(scrollable.getConf().prev);//获取配置对象中的prev属性
scrollable.getConf().speed=200;//设置配置对象的speed属性
//alert(scrollable.getIndex());//获取当前滚动项的索引
//alert(scrollable.getItems().length);//获取当前滚动项的数量
//alert(scrollable.getItemWrap().html());//获取包含滚动项的节点(class=scrollable),并将所有滚动项显示出来
//alert(scrollable.getPageAmount());//获取当前滚动栏分页数
//alert(scrollable.getPageIndex());//获取当前所在分页
//alert(scrollable.getRoot().html());//获取滚动项的上一级节点(id=thumbs)
//alert(scrollable.getSize());
//alert(scrollable.getVisibleItems().length);//获取当前可见滚动项数量
scrollable.next();//如果有下一个滚动项,则跳转到下一个滚动项
scrollable.prev(3000,function(){return true});//跳转到前一滚动项
//var seekTo=
scrollable.click(0).seekTo(2,1000,function(){
//alert(this.getIndex());
//});
//scrollable.move(2);
//scrollable.prevPage();//跳转到前一页
//scrollable.nextPage();//跳转到下一页
//scrollable.setPage(1);//跳转到下一页
//scrollable.begin();//跳转到第一个滚动项
//scrollable.end();//跳转到最后一个滚动项
scrollable.click(3);//使第四个滚动项处于选中状态
scrollable.onBeforeSeek(function(){
alert("you click the
"+this.getIndex()+"st scrollable item!");
});
$("#remove").click(function(){
scrollable.getItems().filter(":last").remove();//删除最后一个滚动项
scrollable.reload().prev();//自动更新相关配置信息,并跳转到被删除滚动项的前一项
});
});
// --></script>
http://blog.csdn.net/tinico/article/details/18033493
http://www.tuicool.com/articles/3QVnee
http://www.17sucai.com/pins/6509.html
原文链接:
http://www.poluoluo.com/jzxy/201110/143879.html?jdfwkey=zqwzi
http://www.poluoluo.com/jzxy/201110/143880.html?jdfwkey=fqfy21
jQueryTools-Scrollable.js的更多相关文章
- 基于MVC4+EasyUI的Web开发框架经验总结(4)--使用图表控件Highcharts
在我们做各种应用的时候,我们可能都会使用到图表统计,以前接触过一些不同的图表控件,在无意中发现了图表控件Highcharts,其强大的功能和丰富的互动效果,令人难以忘怀.本篇主要介绍在Web开发中使用 ...
- 基于MVC4+EasyUI的Web开发框架形成之旅--界面控件的使用
在前面介绍了两篇关于我的基于MVC4+EasyUI技术的Web开发框架的随笔,本篇继续介绍其中界面部分的一些使用知识,包括控件的赋值.取值.清空,以及相关的使用. 我们知道,一般Web界面包括的界面控 ...
- 转--基于MVC4+EasyUI的Web开发框架形成之旅--界面控件的使用
原文 http://www.cnblogs.com/wuhuacong/p/3317223.html 基于MVC4+EasyUI的Web开发框架形成之旅--界面控件的使用 在前面介绍了两篇关于我的基 ...
- 毕业设计 ASP.Net+EasyUI开发 X X露天矿调度管理信息系统(一)
开篇介绍关于EasyUI技术,界面部分的一些使用知识,包括控件的赋值.取值.清空,以及相关的使用. 我们知道,一般Web界面包括的界面控件有:单行文本框.多行文本框.密码文本框.下拉列表Combobo ...
- (转)基于MVC4+EasyUI的Web开发框架形成之旅--界面控件的使用
原文地址:http://www.cnblogs.com/wuhuacong/p/3317223.html 在前面介绍了两篇关于我的基于MVC4+EasyUI技术的Web开发框架的随笔,本篇继续介绍其中 ...
- (转)基于MVC4+EasyUI的Web开发框架经验总结(4)--使用图表控件Highcharts
http://www.cnblogs.com/wuhuacong/p/3736564.html 在我们做各种应用的时候,我们可能都会使用到图表统计,以前接触过一些不同的图表控件,在无意中发现了图表控件 ...
- Swiper.js 中文API手册
本文分享自 http://www.cnblogs.com/scavengers/p/3760449.html ---------------------------华丽的分割线------------ ...
- prototype.js源码
prototype 1.3.1 版本和之前的 1.2.0 版本有了不少改进,并增加了新的功能: 1. 增加了事件注册管理2. 增加了空间定位的常用函数3. 改善了 xmlhttp 的封装4. 移除了 ...
- Web打印使用printThis.js
<script src="~/Content/JQueryTools/printThis/printThis.js"></script>
随机推荐
- PHP代码静态分析工具PHPStan
最近发现自己写的PHP代码运行结果总跟自己预想的不一样,排查时发现大多是语法错误,在运行之前错误已经种下.可能是自己粗心大意,或者说php -l检测太简单,不过的确是有一些语法错误埋藏得太深(毕竟PH ...
- 正确的在循环list的时候删除list里面的元素
s = [1,2,3,4,5] for i in s: s.remove(i) print(s) 输出结果:[2, 4] 1.当第一次删除后,后面的元素会前移,此时s=[2,3,4,5], 2.然 ...
- accept阻塞
一直以来以为accept阻塞的时候,若另有线程关闭相应的监听套接字,accept会立即返回. 今天先是在NDK上试,没反应.又在ARCHLINUX试了下,还是没反应.难道是我一直记的都是错的!!!!! ...
- java增强for循环中获取index
java增强for循环中获取index http://rensanning.iteye.com/blog/2003205
- noip模拟赛 游
[问题背景]zhx 和他的妹子出去玩.[问题描述]zhx 和他的妹子去一个国家旅游,共有 N 个旅游景点, N-1 条双向连接的道路将它们联通起来, 每一条道路有固定长度. 一开始 zhx 位于 1 ...
- 工资(money)
(money/money.in/money.out) 时限1000ms 内存256MB 聪哥在暑假参加了打零工的活动,这个活动分为n个工作日,每个工作日的工资为Vi.有m个结算工钱的时间,聪哥可以自由 ...
- Codeforces Round #403(div 2)
A =w= B 题意:一个数轴上有n个整点,每个点都有一个速度,选一个点让他们集合,使得时间最少. 分析: 直接三分 C 题意:给定一棵树,任意两个距离小等于二的点不能染相同的颜色,求最小颜色数和染色 ...
- java包静态导入,继承
/** * 静态导入 */package cn.sxt.gao;import cn.sxt.oo.*;//用别的包的类需要导入别的包,表示该包下所有类全部导入import java.util.Date ...
- 4、Java并发性和多线程-并发编程模型
以下内容转自http://ifeve.com/%E5%B9%B6%E5%8F%91%E7%BC%96%E7%A8%8B%E6%A8%A1%E5%9E%8B/: 并发系统可以采用多种并发编程模型来实现. ...
- Username is not in the sudoers file. This incident will be reported
type sudo adduser <username> sudo where username is the name of the user you want to add in th ...