jQuery Tools tab(幻灯片) - Web前端
作者:98wpeu发布时间:2026-09-26分类:网页前端技术浏览:19
导读:html复制代码代码如下:<!DOCtypeHTML><html><head><title>JQueryToolssta...
html
复制代码 代码如下:
<!DOCtypeHTML>
<html>
<head>
<title>JQuery Tools standalone demo</title>
<!-- include the Tools -->
<script src="http://CDN.jQuerytools.org/1.2.7/full/jquery.tools.min.JS"></script>
<link rel="StyleSheet" type="text/CSS"
href="./tabs-slideshow.css"/>
</head>
<body><!-- "PRevious slide" button -->
<a class="backward">prev</a>
<!-- contAIner for the slides -->
<div class="images">
<!-- first slide -->
<div>
<h3>First pane</h3>
<p style="font-weight:bold">
Aenean nec imperdiet ligula. Cum sociis natoque penatibus et
magnis dis parturIEnt montes, nascetur ridiculus mus.
</p>
<p>
Suspendisse potenti. Sed elementum risus eleifend massa
vestibulum consectetur. DUIs massa augue, aliquam eget fringilla
vel, aliquam vitae arcu. Nam sed magna mi. Praesent odio neque,
dAPIbus sit amet suscipit at, tempus sed nibh. Aliquam sagittis
ligula in ligula faucibus cursus. Quisque vulputate pellentesque
facilisis.
</p>
</div>
<!-- second slide -->
<div>
<h3>Second pane</h3>
<p style="font-weight:bold">
Consectetur adipiscing elit. Praesent bibendum eros ac
nulla. integer vel lacus ac neque viverra.
</p>
<p>
Vivamus euismod euismod saGittis. Etiam cursus neque non lectus
mattis cursus et a libero. Vivamus condimentum hendrerit metus,
a sollicitudin magna vulputate eu. Donec sed tincidunt
lectus. Donec tellus lectus, fermentum sit amet porta non,
rhoncus ac mi. Quisque placerat auctor justo, a egestas urna
tincidunt eleifend.
</p>
</div>
<!-- third slide -->
<div>
<h3>Third pane</h3>
<p style="font-weight:bold">
Non lectus lacinia egestas. Nulla hendrerit, felis quis
elementum viverra, purus felis egestas magna.
</p>
<p>
Aenean elit lorem, pretium vitae dictum in, fermentum consequat
dolor. Proin consectetur sollicitudin tellus, non elementum
turpis pharetra non. Sed quis tellus quam.
</p>
</div>
</div>
<!-- "next slide" button -->
<a class="forward">next</a>
<!-- the TABs -->
<div class="slidetabs">
<a href="#"></a>
<a href="#"></a>
<a href="#"></a>
</div>
<div style="clear:both;margin:30px 0 0;text-align:center;">
<button onClick='$(".slidetabs").data("slideshow").play();'>Play</button>
<button onClick='$(".slidetabs").data("slideshow").stop();'>Stop</button>
</div>
<script language="javascript">
$(function() {
$(".slidetabs").tabs(".images > div", {
// enable "cross-fading" effect
effect: 'fade',
fadeOutspeed: "slow",
// start from the beginning after the last tab
rotate: true
// use the slideshow plugin. It accepts its own configuration
}).slideshow();
});
</script>
</body>
</html>
css
复制代码 代码如下:
/* container for slides */
.images {
background:#fff repeat-x;
border:1px solid #ccc;
position:relative;
height:300px;
width:560px;
float:left;
margin:15px;
cursor:pointer;
/* css3 tweaks for modern browsers */
-moz-border-radius:5px;
-WEBkit-border-radius:5px;
-moz-box-shadow:0 0 25px #666;
-webkit-box-shadow:0 0 25px #666;
}
/* single slide */
.images div {
display:none;
position:absolute;
top:0;
left:0;
margin:7px;
padding:15px 30px 15px 15px;
height:256px;
font-size:12px;
}
/* header */
.images h3 {
font-size:22px;
font-weight:normal;
margin:0 0 20px 0;
color:#456;
}
/* tabs (those little circles below slides) */
.slidetabs {
clear:both;
margin-left:310px;
}
/* single tab */
.slidetabs a {
width:8px;
height:8px;
float:left;
margin:3px;
background:url(./navigator.png) 0 0 no-repeat;
display:block;
font-size:1px;
}
/* mouSEOver state */
.slidetabs a:hover {
background-position:0 -8px;
}
/* active state (current page state) */
.slidetabs a.current {
background-position:0 -16px;
}
/* prev and next buttons */
.forward, .backward {
float:left;
margin-top:140px;
background:#fff url(./hori_large.png) no-repeat;
display:block;
width:30px;
height:30px;
Cursor:pointer;
font-size:1px;
text-indent:-9999em;
}
/* next */
.forward { background-position: 0 -30px; clear:right; }
.forward:hover { background-position:-30px -30px; }
.forward:active { background-position:-60px -30px; }
/* prev */
.backward:hover { background-position:-30px 0; }
.backward:active { background-position:-60px 0; }
/* disabled navigational button. is not needed when tabs are
configured with rotate: true */
.disabled {
visibility:hidden !important;
}
PS:用到些图片
复制代码 代码如下:
$(function() {
$(".slidetabs").tabs(".images > div", {
// enable "cross-fading" effect
effect: 'fade',
fadeOutSpeed: "slow",
next:'.forward',
prev:'.backward',
// start from the beginning after the last tab
rotate: true
// use the slideshow plugin. It accepts its own configuration
}).slideshow();
});
这个同html中的js
•配置
配置选项的完整列表的幻灯片插件。
复制代码 代码如下:
<!DOCtypeHTML>
<html>
<head>
<title>JQuery Tools standalone demo</title>
<!-- include the Tools -->
<script src="http://CDN.jQuerytools.org/1.2.7/full/jquery.tools.min.JS"></script>
<link rel="StyleSheet" type="text/CSS"
href="./tabs-slideshow.css"/>
</head>
<body><!-- "PRevious slide" button -->
<a class="backward">prev</a>
<!-- contAIner for the slides -->
<div class="images">
<!-- first slide -->
<div>
<h3>First pane</h3>
<p style="font-weight:bold">
Aenean nec imperdiet ligula. Cum sociis natoque penatibus et
magnis dis parturIEnt montes, nascetur ridiculus mus.
</p>
<p>
Suspendisse potenti. Sed elementum risus eleifend massa
vestibulum consectetur. DUIs massa augue, aliquam eget fringilla
vel, aliquam vitae arcu. Nam sed magna mi. Praesent odio neque,
dAPIbus sit amet suscipit at, tempus sed nibh. Aliquam sagittis
ligula in ligula faucibus cursus. Quisque vulputate pellentesque
facilisis.
</p>
</div>
<!-- second slide -->
<div>
<h3>Second pane</h3>
<p style="font-weight:bold">
Consectetur adipiscing elit. Praesent bibendum eros ac
nulla. integer vel lacus ac neque viverra.
</p>
<p>
Vivamus euismod euismod saGittis. Etiam cursus neque non lectus
mattis cursus et a libero. Vivamus condimentum hendrerit metus,
a sollicitudin magna vulputate eu. Donec sed tincidunt
lectus. Donec tellus lectus, fermentum sit amet porta non,
rhoncus ac mi. Quisque placerat auctor justo, a egestas urna
tincidunt eleifend.
</p>
</div>
<!-- third slide -->
<div>
<h3>Third pane</h3>
<p style="font-weight:bold">
Non lectus lacinia egestas. Nulla hendrerit, felis quis
elementum viverra, purus felis egestas magna.
</p>
<p>
Aenean elit lorem, pretium vitae dictum in, fermentum consequat
dolor. Proin consectetur sollicitudin tellus, non elementum
turpis pharetra non. Sed quis tellus quam.
</p>
</div>
</div>
<!-- "next slide" button -->
<a class="forward">next</a>
<!-- the TABs -->
<div class="slidetabs">
<a href="#"></a>
<a href="#"></a>
<a href="#"></a>
</div>
<div style="clear:both;margin:30px 0 0;text-align:center;">
<button onClick='$(".slidetabs").data("slideshow").play();'>Play</button>
<button onClick='$(".slidetabs").data("slideshow").stop();'>Stop</button>
</div>
<script language="javascript">
$(function() {
$(".slidetabs").tabs(".images > div", {
// enable "cross-fading" effect
effect: 'fade',
fadeOutspeed: "slow",
// start from the beginning after the last tab
rotate: true
// use the slideshow plugin. It accepts its own configuration
}).slideshow();
});
</script>
</body>
</html>
css
复制代码 代码如下:
/* container for slides */
.images {
background:#fff repeat-x;
border:1px solid #ccc;
position:relative;
height:300px;
width:560px;
float:left;
margin:15px;
cursor:pointer;
/* css3 tweaks for modern browsers */
-moz-border-radius:5px;
-WEBkit-border-radius:5px;
-moz-box-shadow:0 0 25px #666;
-webkit-box-shadow:0 0 25px #666;
}
/* single slide */
.images div {
display:none;
position:absolute;
top:0;
left:0;
margin:7px;
padding:15px 30px 15px 15px;
height:256px;
font-size:12px;
}
/* header */
.images h3 {
font-size:22px;
font-weight:normal;
margin:0 0 20px 0;
color:#456;
}
/* tabs (those little circles below slides) */
.slidetabs {
clear:both;
margin-left:310px;
}
/* single tab */
.slidetabs a {
width:8px;
height:8px;
float:left;
margin:3px;
background:url(./navigator.png) 0 0 no-repeat;
display:block;
font-size:1px;
}
/* mouSEOver state */
.slidetabs a:hover {
background-position:0 -8px;
}
/* active state (current page state) */
.slidetabs a.current {
background-position:0 -16px;
}
/* prev and next buttons */
.forward, .backward {
float:left;
margin-top:140px;
background:#fff url(./hori_large.png) no-repeat;
display:block;
width:30px;
height:30px;
Cursor:pointer;
font-size:1px;
text-indent:-9999em;
}
/* next */
.forward { background-position: 0 -30px; clear:right; }
.forward:hover { background-position:-30px -30px; }
.forward:active { background-position:-60px -30px; }
/* prev */
.backward:hover { background-position:-30px 0; }
.backward:active { background-position:-60px 0; }
/* disabled navigational button. is not needed when tabs are
configured with rotate: true */
.disabled {
visibility:hidden !important;
}
PS:用到些图片


复制代码 代码如下:
$(function() {
$(".slidetabs").tabs(".images > div", {
// enable "cross-fading" effect
effect: 'fade',
fadeOutSpeed: "slow",
next:'.forward',
prev:'.backward',
// start from the beginning after the last tab
rotate: true
// use the slideshow plugin. It accepts its own configuration
}).slideshow();
});
这个同html中的js
•配置
配置选项的完整列表的幻灯片插件。
| 属性 | 默认值 | 描述 |
|---|---|---|
| next | '.forward' | 选择器进行的元素的“下一个选项卡”行动应该 绑定。 如果您实例化多个幻灯片在相同的页面上 你需要附上所有幻灯片元素(标签/窗格/下 &上一页动作)在一个共同的包装器元素。 这种逻辑 遵循 相同的原则 作为创建 多个选项卡的实例。prev |
| prev | '.backward' | 选择器的兄弟元素“之前的选项卡” 动作应该绑定。 如果您实例化多个幻灯片 与相同的电话,你需要附上所有幻灯片元素 (标签/窗格/下&上一页动作)在一个共同的包装器 元素。 这种逻辑遵循 相同 原则 作为创建多个选项卡的实例。 |
| disabledClass | 'disabled' | CSS类名'disabled'上一页 和 接下来 元素。 例如, 这个 上一页 元素是当没有'disabled'的 前面提及的卷轴。 |
| autoplay | false | 如果这个属性设置为 真正的 然后选项卡将 自动前进到下一个选项卡实现 自动“玩”的幻灯片。 这是方便 使 旋转 属性选项卡。 |
| autopause | true | 如果这个属性设置为 真正的 ,当未来/上一页 选项卡操作按钮是mouseovered然后autoplay 功能将会暂停。 |
| interval | 3000 | 时间(以毫秒为单位)自动走到之间 选项卡。 只有当这个选项是有效的 自动播放 是 启用或 autoplay 方法被调用。 |
| clickable | true | 当设置为 真正的 然后选项卡将自动 推进到下一个选项卡通过单击可见的窗格。 |
JavaScript API
| 方法 | 返回值 | 描述/例子 |
|---|---|---|
| getconf | Object | 自从1.2.0 。 返回配置对象 对于这个插件 |
| getTabs | Tabs | 自从1.2.0 。 返回一个引用 这个 标签API 。 |
| play | API | 开始播放幻灯片。 |
| pause | API | 暂停幻灯片。 回放将恢复鼠标脱离了标签,窗格和导航按钮。 |
| stop | API | 停止幻灯片。 这只能通过调用恢复 这个 play 方法。 |
事件
确保你已经阅读 大约 事件 jquery工具 。 所有事件监听器接收 这个 事件 对象 作为第一个参数。
| 事件 | 触发时间 |
|---|---|
| onBeforePlay | 开始之前播放。 返回 false 在 回调防止回放开始。 |
| onPlay | 当回放开始。 |
| onBeforePause | 在播放暂停。 返回 false 在 回调防止回放开始。 |
| onPause | 当播放暂停。 |
相关推荐
- jQuery Tab插件 用于在Tab中显示iframe,附源码和详细说明 - Web前端
- jQuery 瀑布流 浮动布局(一)(延迟AJAX加载图片) - Web前端
- 初窥JQuery(二) 事件机制(1) - Web前端
- 基于JQUERY的两个ListBox子项互相调整的实现代码 - Web前端
- 锋利的jQuery 要点归纳(三) jQuery中的事件和动画(上:事件篇) - Web前端
- Jquery ThickBox插件使用心得(不建议使用) - Web前端
- 基于jquery的兼容各种浏览器的iframe自适应高度的脚本 - Web前端
- jquery validation插件表单验证的一个例子 - Web前端
- jQuery应用开发技巧续篇 - Web前端
- 关于jquery事件delegate(),您有了解吗? - Web前端
- 网页前端技术排行
-
- 1[Web前端]用javascript实现默认图片替代未显示的图片 - Web前端
- 2分析Iconfont-阿里巴巴矢量常用图标库 - Web前端
- 3jQuery实例教程:制作网页中可折叠的面板 - Web前端
- 4【第六章】Foundation之按钮和下拉功能 - Web前端
- 5基于jquery的滚动条滚动固定div(附演示下载) - Web前端
- 6jQuery编写widget的一些技巧分享 - Web前端
- 7分享精心挑选的12款优秀jQuery Ajax分页插件和教程 - Web前端
- 8jQuery实现鼠标移到元素上动态提示消息框效果 - Web前端
- 9在Mac/PC上远程调试iPhone/iPad上的网页 - Web前端
- 最近发表
-
- WordPress随机显示特色图片插件:Random Post Thumbnails
- KeePass实现Chrome浏览器自动填充密码方法一
- LNMP一键包nginx 301强制跳转到https教程
- KeePass实现Chrome浏览器自动填充密码方法二
- #建站# 免费的VPS管理软件Xshell8/Xftp8中文版下载
- 使用Xshell 8连接VPS教程_电脑登录vps的方法
- WordPress评论界面添加烟花????效果
- 不同浏览器书签同步方案:坚果云+Floccus_详细使用教程
- iOS端KeePassXC客户端APP:Strongbox Password Safe
- 给WordPress评论中的Gravatar头像图片添加ALT属性


