Skip to content

Commit 2f020ae

Browse files
committed
Update demo page
1 parent 02badaa commit 2f020ae

File tree

4 files changed

+53
-4
lines changed

4 files changed

+53
-4
lines changed

index.html

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8">
5-
<title>Tabslet jquery plugin | Yet another plugin for tabs</title>
5+
<title>Tabslet jQuery plugin | Yet another plugin for tabs</title>
66
<meta name="description" content="Yet another plugin for tabs">
77

88
<!-- STYLES -->
@@ -56,7 +56,7 @@ <h2>A jQuery plugin for tabs</h2>
5656
<article>
5757
<h2>
5858
Tabslet is yet another jQuery plugin for tabs, is compatible with IE7+, Chrome, Firefox, Safari and jQuery 1.8.1, 1.9.1, 1.10.1, 2.0.2. and
59-
supports <a class="anchorLink" href="#custom_event">custom events</a>, <a class="anchorLink" href="#rotation">rotation</a> and <a class="anchorLink" href="#animation">animation</a></h2>
59+
supports <a class="anchorLink" href="#custom_event">custom events</a>, <a class="anchorLink" href="#rotation">rotation</a>, <a class="anchorLink" href="#animation">animation</a> and <a class="anchorLink" href="#controls">controls</a></h2>
6060
</article>
6161
</section>
6262
<h3>Demonstration</h3>
@@ -138,6 +138,25 @@ <h2>Rotation</h2>
138138
<div id='tab-3'><h3>It's alive!!!</h3></div>
139139
</div>
140140
</article>
141+
<article id="controls">
142+
<h2>Controls</h2>
143+
<pre data-language="javascript">
144+
$('.tabs').tabslet();
145+
</pre>
146+
<div class='tabs tabs_controls'>
147+
<a class="prev">previous</a>
148+
<a class="next">next</a>
149+
<span class='clear'></span>
150+
<ul class='horizontal'>
151+
<li><a href="#tab-1">information</a></li>
152+
<li><a href="#tab-2">tab</a></li>
153+
<li><a href="#tab-3">tab</a></li>
154+
</ul>
155+
<div id='tab-1'><h3>Tab 1</h3></div>
156+
<div id='tab-2'><h3>Tab 2</h3></div>
157+
<div id='tab-3'><h3>Tab 3</h3></div>
158+
</div>
159+
</article>
141160
<!-- CONTENT BLOCK ends -->
142161

143162
</section>
@@ -214,7 +233,7 @@ <h2>The attribute "data-toggle"</h2>
214233
<footer>
215234
<!-- FOOTER CONTAINER-->
216235
<div class="footer_wrapper">
217-
<p>Built by <a href="https://github.com/vdw">vdw</a> aka <a href="http://gr.linkedin.com/in/dkrestos/" target="_blank">Dimitris Krestos</a></p><p>Code licensed under <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache License v2.0</a></p>
236+
<p>Built by <a href="https://github.com/vdw">vdw</a> aka <a href="http://gr.linkedin.com/in/dkrestos/" target="_blank">Dimitris Krestos</a><br />Code licensed under <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache License v2.0</a></p>
218237
</div>
219238
<!-- FOOTER CONTAINER ends -->
220239
</footer>

javascripts/initializers.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ $(document).ready(function() {
2222
delay: 6000
2323
});
2424

25+
$('.tabs_controls').tabslet({
26+
autorotate: true,
27+
delay: 6000
28+
});
29+
2530
$('.before_event').tabslet();
2631
$('.before_event').on("_before", function() {
2732
alert('This alert comes before the tab change!')

javascripts/vendor/jquery.tabslet.min.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222
2323
*/
2424

25-
(function($,window,undefined){"use strict";$.fn.tabslet=function(options){var defaults={mouseevent:"click",attribute:"href",animation:false,autorotate:false,delay:6e3,active:1};var options=$.extend(defaults,options);$(this).each(function(){function next(){i=++i%elements.length;options.mouseevent=="hover"?elements.eq(i).trigger("mouseover"):elements.eq(i).click();var e=setTimeout(next,options.delay);$this.mouseover(function(){clearTimeout(e)})}var $this=$(this);$this.find("> div").hide();$this.find("> div").eq(options.active-1).show();$this.find("> ul li").eq(options.active-1).addClass("active");var fn=eval(function(){$(this).trigger("_before");$this.find("> ul li").removeClass("active");$(this).addClass("active");$this.find("> div").hide();var e=$(this).find("a").attr(options.attribute);if(options.animation){$this.find(e).animate({opacity:"show"},"slow",function(){$(this).trigger("_after")})}else{$this.find(e).show();$(this).trigger("_after")}return false});var init=eval("$this.find('> ul li')."+options.mouseevent+"(fn)");init;var elements=$this.find("> ul li"),i=options.active-2;if(options.autorotate){setTimeout(next,0)}})};$(document).ready(function(){$('[data-toggle="tabslet"]').tabslet()})})(jQuery)
25+
(function($,window,undefined){$.fn.tabslet=function(options){var defaults={mouseevent:"click",attribute:"href",animation:false,autorotate:false,delay:6000,active:1,controls:{prev:".prev",next:".next"}};var options=$.extend(defaults,options);$(this).each(function(){var $this=$(this);$this.find("> div").hide();$this.find("> div").eq(options.active-1).show();$this.find("> ul li").eq(options.active-1).addClass("active");var fn=eval(function(){$(this).trigger("_before");$this.find("> ul li").removeClass("active");$(this).addClass("active");$this.find("> div").hide();var currentTab=$(this).find("a").attr(options.attribute);if(options.animation){$this.find(currentTab).animate({opacity:"show"},"slow",function(){$(this).trigger("_after")})}else{$this.find(currentTab).show();$(this).trigger("_after")}return false});var init=eval("$this.find('> ul li')."+options.mouseevent+"(fn)");init;var elements=$this.find("> ul li"),i=options.active-1;function forward(){i=++i%elements.length;options.mouseevent=="hover"?elements.eq(i).trigger("mouseover"):elements.eq(i).click();var t=setTimeout(forward,options.delay);$this.mouseover(function(){clearTimeout(t)})}if(options.autorotate){setTimeout(forward,0)}function move(direction){if(direction=="forward"){i=++i%elements.length}if(direction=="backward"){i=--i%elements.length}elements.eq(i).click()}$(this).find(options.controls.next).click(function(){move("forward")});$(this).find(options.controls.prev).click(function(){move("backward")})})};$(document).ready(function(){$('[data-toggle="tabslet"]').tabslet()})})(jQuery);

stylesheets/styles.css

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ H2 {
3131
font-weight: 300;
3232
}
3333

34+
/* Clear fix */
35+
.clear {
36+
clear: both;
37+
display: block;
38+
float: none;
39+
font-size: 1px;
40+
height: 0px;
41+
line-height: 0
42+
}
43+
3444
/**
3545
* HEADER
3646
* Your header rules
@@ -257,4 +267,19 @@ FOOTER {
257267
.screenshot {
258268
position: absolute;
259269
clip: rect(0 0 0 0);
270+
}
271+
272+
.prev,
273+
.next {
274+
background: white !important;
275+
color: #a0cac0 !important;
276+
float: left;
277+
margin-right: 10px;
278+
margin-bottom: 10px;
279+
}
280+
281+
.prev:hover,
282+
.next:hover {
283+
background: #a0cac0 !important;
284+
color: white !important;
260285
}

0 commit comments

Comments
 (0)