Skip to content

Commit f96aec3

Browse files
committed
Update to version 1.7.1
1 parent e895b4f commit f96aec3

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<div class="twelve columns">
5151
<h1><img src="images/tabslet_logo.png" class="logo">Tabslet</h1>
5252
<h2>A jQuery plugin for tabs</h2>
53-
<a class="button" href="https://github.com/vdw/Tabslet/archive/master.zip">download <small>v1.4.9</small></a>
53+
<a class="button" href="https://github.com/vdw/Tabslet/archive/master.zip">download <small>v1.7.1</small></a>
5454
<a class="link" href="https://github.com/vdw/Tabslet">or view on GitHub</a>
5555
</div>
5656
</div>

javascripts/vendor/jquery.tabslet.min.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @copyright Copyright 2015, Dimitris Krestos
55
* @license Apache License, Version 2.0 (http://www.opensource.org/licenses/apache2.0.php)
66
* @link http://vdw.staytuned.gr
7-
* @version v1.4.9
7+
* @version v1.7.1
88
*/
99

1010
/* Sample html structure
@@ -20,6 +20,21 @@
2020
<div id='tab-3'></div>
2121
</div>
2222
23+
OR
24+
25+
<div class='tabs'>
26+
<ul class='horizontal'>
27+
<li><a href="#tab-1">Tab 1</a></li>
28+
<li><a href="#tab-2">Tab 2</a></li>
29+
<li><a href="#tab-3">Tab 3</a></li>
30+
</ul>
31+
</div>
32+
<div id='tabs_container'>
33+
<div id='tab-1'></div>
34+
<div id='tab-2'></div>
35+
<div id='tab-3'></div>
36+
</div>
37+
2338
*/
2439

25-
!function($,window,undefined){"use strict";$.fn.tabslet=function(options){var defaults={mouseevent:"click",attribute:"href",animation:!1,autorotate:!1,pauseonhover:!0,delay:2e3,active:1,controls:{prev:".prev",next:".next"}},options=$.extend(defaults,options);return this.each(function(){var $this=$(this),_cache_li=[],_cache_div=[];$this.find("> div").each(function(){_cache_div.push($(this).css("display"))});var elements=$this.find("> ul li"),i=options.active-1;if(!$this.data("tabslet-init")){$this.data("tabslet-init",!0),options.mouseevent=$this.data("mouseevent")||options.mouseevent,options.attribute=$this.data("attribute")||options.attribute,options.animation=$this.data("animation")||options.animation,options.autorotate=$this.data("autorotate")||options.autorotate,options.pauseonhover=$this.data("pauseonhover")||options.pauseonhover,options.delay=$this.data("delay")||options.delay,options.active=$this.data("active")||options.active,$this.find("> div").hide(),options.active&&($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(),i=elements.index($(this));var t=$(this).find("a").attr(options.attribute);return options.animation?$this.find(t).animate({opacity:"show"},"slow",function(){$(this).trigger("_after")}):($this.find(t).show(),$(this).trigger("_after")),!1}),init=eval("$this.find('> ul li')."+options.mouseevent+"(fn)"),t,forward=function(){i=++i%elements.length,"hover"==options.mouseevent?elements.eq(i).trigger("mouseover"):elements.eq(i).click(),options.autorotate&&(clearTimeout(t),t=setTimeout(forward,options.delay),$this.mouseover(function(){options.pauseonhover&&clearTimeout(t)}))};options.autorotate&&(t=setTimeout(forward,options.delay),$this.hover(function(){options.pauseonhover&&clearTimeout(t)},function(){t=setTimeout(forward,options.delay)}),options.pauseonhover&&$this.on("mouseleave",function(){clearTimeout(t),t=setTimeout(forward,options.delay)}));var move=function(t){"forward"==t&&(i=++i%elements.length),"backward"==t&&(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")}),$this.on("destroy",function(){$(this).removeData().find("> ul li").each(function(){$(this).removeClass("active")}),$(this).find("> div").each(function(t){$(this).removeAttr("style").css("display",_cache_div[t])})})}})},$(document).ready(function(){$('[data-toggle="tabslet"]').tabslet()})}(jQuery);
40+
!function($,window,undefined){"use strict";$.fn.tabslet=function(options){var defaults={mouseevent:"click",attribute:"href",animation:!1,autorotate:!1,deeplinking:!1,pauseonhover:!0,delay:2e3,active:1,container:!1,controls:{prev:".prev",next:".next"}},options=$.extend(defaults,options);return this.each(function(){var $this=$(this),_cache_li=[],_cache_div=[],_container=options.container?$(options.container):$this,_tabs=_container.find("> div");_tabs.each(function(){_cache_div.push($(this).css("display"))});var elements=$this.find("> ul > li"),i=options.active-1;if(!$this.data("tabslet-init")){$this.data("tabslet-init",!0),$this.opts=[],$.map(["mouseevent","attribute","animation","autorotate","deeplinking","pauseonhover","delay","container"],function(t,e){$this.opts[t]=$this.data(t)||options[t]}),$this.opts.active=$this.opts.deeplinking?deep_link():$this.data("active")||options.active,_tabs.hide(),$this.opts.active&&(_tabs.eq($this.opts.active-1).show(),elements.eq($this.opts.active-1).addClass("active"));var fn=eval(function(t,e){var o=e?elements.find("a["+$this.opts.attribute+"="+e+"]").parent():$(this);o.trigger("_before"),elements.removeClass("active"),o.addClass("active"),_tabs.hide(),i=elements.index(o);var n=e||o.find("a").attr($this.opts.attribute);return $this.opts.deeplinking&&(location.hash=n),$this.opts.animation?_container.find(n).animate({opacity:"show"},"slow",function(){o.trigger("_after")}):(_container.find(n).show(),o.trigger("_after")),!1}),init=eval("elements."+$this.opts.mouseevent+"(fn)"),t,forward=function(){i=++i%elements.length,"hover"==$this.opts.mouseevent?elements.eq(i).trigger("mouseover"):elements.eq(i).click(),$this.opts.autorotate&&(clearTimeout(t),t=setTimeout(forward,$this.opts.delay),$this.mouseover(function(){$this.opts.pauseonhover&&clearTimeout(t)}))};$this.opts.autorotate&&(t=setTimeout(forward,$this.opts.delay),$this.hover(function(){$this.opts.pauseonhover&&clearTimeout(t)},function(){t=setTimeout(forward,$this.opts.delay)}),$this.opts.pauseonhover&&$this.on("mouseleave",function(){clearTimeout(t),t=setTimeout(forward,$this.opts.delay)}));var deep_link=function(){var t=[];elements.find("a").each(function(){t.push($(this).attr($this.opts.attribute))});var e=$.inArray(location.hash,t);return e>-1?e+1:$this.data("active")||options.active},move=function(t){"forward"==t&&(i=++i%elements.length),"backward"==t&&(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")}),$this.on("show",function(t,e){fn(t,e)}),$this.on("next",function(){move("forward")}),$this.on("prev",function(){move("backward")}),$this.on("destroy",function(){$(this).removeData().find("> ul li").each(function(t){$(this).removeClass("active")}),_tabs.each(function(t){$(this).removeAttr("style").css("display",_cache_div[t])})})}})},$(document).ready(function(){$('[data-toggle="tabslet"]').tabslet()})}(jQuery);

0 commit comments

Comments
 (0)