Home > Web Front-end > JS Tutorial > jQuery Tools tab(slideshow)_jquery

jQuery Tools tab(slideshow)_jquery

WBOY
Release: 2016-05-16 17:52:03
Original
1282 people have browsed it

html

复制代码 代码如下:




jQuery Tools standalone demo


href="./tabs-slideshow.css"/>


prev




First pane



Aenean nec imperdiet ligula. Cum sociis natoque penatibus et
magnis dis parturient montes, nascetur ridiculus mus.



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.





Second pane



Consectetur adipiscing elit. Praesent bibendum eros ac
nulla. Integer vel lacus ac neque viverra.



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.





Third pane



Non lectus lacinia egestas. Nulla hendrerit, felis quis
elementum viverra, purus felis egestas magna.



Aenean elit lorem, pretium vitae dictum in, fermentum consequat
dolor. Proin consectetur sollicitudin tellus, non elementum
turpis pharetra non. Sed quis tellus quam.





next














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:用到些图片

实例js
复制代码 代码如下:

$(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();
});

This is the same js in html
•Configuration
Slideshow plugin with a complete list of configuration options.
prevThe selector's sibling "previous tab" action should be bound. If you instantiate multiple slides with the same call, you need to enclose all slide elements (tabs/panes/next & previous actions) in a common wrapper element. This logic follows the same principles disabledClassautoplayautopauseinterval
Attributes Default value Description
next '.forward' The selector that performs the "next tab" action on the element should be bound. If you instantiate multiple slides on the same page you need to enclose all slide elements (tabs/panes/next & previous page actions) in a common wrapper element. This logic follows the same principles as creating multiple tab instances. prev
<span id="OUTFOX_JTR_TRANS_NODE-44" class="OUTFOX_JTR_TRANS_NODE"><br>'.backward'</span> <span id="OUTFOX_JTR_TRANS_NODE-44" class="OUTFOX_JTR_TRANS_NODE"><span>'.backward'</span></span> as the instance of creating multiple tabs.
'disabled' CSS class name'disabled' Previous page and Continue Down the element. For example, the Previous element is when there is no 'disabled' for the previously mentioned scroll.
false If this property is set to true then the tab will automatically advance to the next tab enabling automatic "playing" of the slideshow . It is convenient to make rotate the properties tab.
true If this property is set to true , when the next/previous tab action button is mouseovered then autoplay function will be suspended.
<span id="OUTFOX_JTR_TRANS_NODE-70" class="OUTFOX_JTR_TRANS_NODE">3000<span></span></span> Time (in milliseconds) to automatically go between tabs. This option is valid only if <span id="OUTFOX_JTR_TRANS_NODE-70" class="OUTFOX_JTR_TRANS_NODE">3000</span> autoplay is enabled or autoplay method is called.
clickable true When set to true then the tab will automatically advance to the next tab by clicking on the visible pane.

JavaScript API

方法 返回值 描述/例子
getconf Object 自从1.2.0 。 返回配置对象 对于这个插件
getTabs Tabs 自从1.2.0 。 返回一个引用 这个 标签API 
play <span id="OUTFOX_JTR_TRANS_NODE-96" class="OUTFOX_JTR_TRANS_NODE">API</span> 开始播放幻灯片。
pause <span id="OUTFOX_JTR_TRANS_NODE-99" class="OUTFOX_JTR_TRANS_NODE">API</span> 暂停幻灯片。 回放将恢复鼠标脱离了标签,窗格和导航按钮。
stop <span id="OUTFOX_JTR_TRANS_NODE-102" class="OUTFOX_JTR_TRANS_NODE">API</span> 停止幻灯片。 这只能通过调用恢复 这个 play 方法。
method Return value

Description/Example

getconf Object Since 1.2.0 . Returns the configuration object for this plugin

事件 触发时间
onBeforePlay 开始之前播放。 返回 false 在 回调防止回放开始。
onPlay 当回放开始。
onBeforePause 在播放暂停。 返回 false  在 回调防止回放开始。
onPause 当播放暂停。
getTabs Tabs Since 1.2.0 . Returns a reference to this tag API . play <span id="OUTFOX_JTR_TRANS_NODE-96" class="OUTFOX_JTR_TRANS_NODE">API</span> Start the slideshow. pause <span id="OUTFOX_JTR_TRANS_NODE-99" class="OUTFOX_JTR_TRANS_NODE">API</span> Pause slideshow. Playback will resume when the mouse is off tabs, panes and navigation buttons. stop <span id="OUTFOX_JTR_TRANS_NODE-102" class="OUTFOX_JTR_TRANS_NODE">API</span> Stop slideshow. This can only be restored by calling the play method. Event Make sure you have read about Events jQuery Tools . All event listeners receive the Event object as the first parameter. onBeforePlay Play before starting. Return false in the callback to prevent playback from starting. onPlay When playback starts. onBeforePause Playing is paused. Back TRANS_NODE> in callback Prevent playback from starting. onPause When playback is paused.
Event Trigger time
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template