Skip to content

Commit 3acd56c

Browse files
author
Dimitris Krestos
committed
Update demo page
1 parent 74e26e1 commit 3acd56c

File tree

3 files changed

+105
-105
lines changed

3 files changed

+105
-105
lines changed

demo/javascripts/vendor/jquery.tabslet.min.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* Tabslet jQuery plugin
2+
* Tabslet | tabs jQuery plugin
33
*
44
* @copyright Copyright 2012, Dimitris Krestos
55
* @license Apache License, Version 2.0 (http://www.opensource.org/licenses/apache2.0.php)
6-
* @link http://vdw.staytuned.gr
6+
* @link http://vdw.staytuned.gr
77
* @version v1.4.2
88
*/
99

@@ -22,4 +22,4 @@
2222
2323
*/
2424

25-
(function($,window,undefined){$.fn.tabslet=function(options){var defaults={mouseevent:"click",attribute:"href",animation:false,autorotate:false,pauseonhover:true,delay:2000,active:1,controls:{prev:".prev",next:".next"}};var options=$.extend(defaults,options);return this.each(function(){var $this=$(this);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();$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(){if(options.pauseonhover){clearTimeout(t)}})}if(options.autorotate){setTimeout(forward,0);if(options.pauseonhover){$this.on("mouseleave",function(){setTimeout(forward,1000)})}}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")});$this.on("destroy",function(){$(this).removeData()})})};$(document).ready(function(){$('[data-toggle="tabslet"]').tabslet()})})(jQuery);
25+
(function($,window,undefined){"use strict";$.fn.tabslet=function(options){var defaults={mouseevent:"click",attribute:"href",animation:false,autorotate:false,pauseonhover:true,delay:2e3,active:1,controls:{prev:".prev",next:".next"}};var options=$.extend(defaults,options);return this.each(function(){var $this=$(this);if(!$this.data("tabslet-init")){$this.data("tabslet-init",true);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();$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-1;var forward=function(){i=++i%elements.length;options.mouseevent=="hover"?elements.eq(i).trigger("mouseover"):elements.eq(i).click();var e=setTimeout(forward,options.delay);$this.mouseover(function(){if(options.pauseonhover)clearTimeout(e)})};if(options.autorotate){setTimeout(forward,0);if(options.pauseonhover)$this.on("mouseleave",function(){setTimeout(forward,1e3)})}var move=function(e){if(e=="forward")i=++i%elements.length;if(e=="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")});$this.on("destroy",function(){$(this).removeData()})}})};$(document).ready(function(){$('[data-toggle="tabslet"]').tabslet()})})(jQuery)

jquery.tabslet.js

Lines changed: 100 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,159 +1,159 @@
11
/**
2-
* Tabs plugin
2+
* Tabslet | tabs jQuery plugin
33
*
4-
* @copyright Copyright 2012, Dimitris Krestos
5-
* @license Apache License, Version 2.0 (http://www.opensource.org/licenses/apache2.0.php)
6-
* @link http://vdw.staytuned.gr
7-
* @version v1.4.2
4+
* @copyright Copyright 2012, Dimitris Krestos
5+
* @license Apache License, Version 2.0 (http://www.opensource.org/licenses/apache2.0.php)
6+
* @link http://vdw.staytuned.gr
7+
* @version v1.4.2
88
*/
99

10-
/* Sample html structure
10+
/* Sample html structure
1111
12-
<div class='tabs'>
13-
<ul class='horizontal'>
14-
<li><a href="#tab-1">Tab 1</a></li>
15-
<li><a href="#tab-2">Tab 2</a></li>
16-
<li><a href="#tab-3">Tab 3</a></li>
17-
</ul>
18-
<div id='tab-1'></div>
19-
<div id='tab-2'></div>
20-
<div id='tab-3'></div>
21-
</div>
12+
<div class='tabs'>
13+
<ul class='horizontal'>
14+
<li><a href="#tab-1">Tab 1</a></li>
15+
<li><a href="#tab-2">Tab 2</a></li>
16+
<li><a href="#tab-3">Tab 3</a></li>
17+
</ul>
18+
<div id='tab-1'></div>
19+
<div id='tab-2'></div>
20+
<div id='tab-3'></div>
21+
</div>
2222
23-
*/
23+
*/
2424

2525
;(function($, window, undefined) {
26-
"use strict";
26+
"use strict";
2727

28-
$.fn.tabslet = function(options) {
28+
$.fn.tabslet = function(options) {
2929

30-
var defaults = {
31-
mouseevent: 'click',
32-
attribute: 'href',
33-
animation: false,
34-
autorotate: false,
35-
pauseonhover: true,
36-
delay: 2000,
37-
active: 1,
38-
controls: {
39-
prev: '.prev',
40-
next: '.next'
41-
}
42-
};
30+
var defaults = {
31+
mouseevent: 'click',
32+
attribute: 'href',
33+
animation: false,
34+
autorotate: false,
35+
pauseonhover: true,
36+
delay: 2000,
37+
active: 1,
38+
controls: {
39+
prev: '.prev',
40+
next: '.next'
41+
}
42+
};
4343

44-
var options = $.extend(defaults, options);
44+
var options = $.extend(defaults, options);
4545

46-
return this.each(function() {
46+
return this.each(function() {
4747

48-
var $this = $(this);
48+
var $this = $(this);
4949

50-
if ( !$this.data( 'tabslet-init' ) ) {
50+
if ( !$this.data( 'tabslet-init' ) ) {
5151

52-
$this.data( 'tabslet-init', true );
52+
$this.data( 'tabslet-init', true );
5353

54-
// Ungly overwrite
55-
options.mouseevent = $this.data('mouseevent') || options.mouseevent;
56-
options.attribute = $this.data('attribute') || options.attribute;
57-
options.animation = $this.data('animation') || options.animation;
58-
options.autorotate = $this.data('autorotate') || options.autorotate;
59-
options.pauseonhover = $this.data('pauseonhover') || options.pauseonhover;
60-
options.delay = $this.data('delay') || options.delay;
61-
options.active = $this.data('active') || options.active;
54+
// Ungly overwrite
55+
options.mouseevent = $this.data('mouseevent') || options.mouseevent;
56+
options.attribute = $this.data('attribute') || options.attribute;
57+
options.animation = $this.data('animation') || options.animation;
58+
options.autorotate = $this.data('autorotate') || options.autorotate;
59+
options.pauseonhover = $this.data('pauseonhover') || options.pauseonhover;
60+
options.delay = $this.data('delay') || options.delay;
61+
options.active = $this.data('active') || options.active;
6262

63-
$this.find('> div').hide();
64-
$this.find('> div').eq(options.active - 1).show();
65-
$this.find('> ul li').eq(options.active - 1).addClass('active');
63+
$this.find('> div').hide();
64+
$this.find('> div').eq(options.active - 1).show();
65+
$this.find('> ul li').eq(options.active - 1).addClass('active');
6666

67-
var fn = eval(
67+
var fn = eval(
6868

69-
function() {
69+
function() {
7070

71-
$(this).trigger('_before');
71+
$(this).trigger('_before');
7272

73-
$this.find('> ul li').removeClass('active');
74-
$(this).addClass('active');
75-
$this.find('> div').hide();
73+
$this.find('> ul li').removeClass('active');
74+
$(this).addClass('active');
75+
$this.find('> div').hide();
7676

77-
var currentTab = $(this).find('a').attr(options.attribute);
77+
var currentTab = $(this).find('a').attr(options.attribute);
7878

79-
if (options.animation) {
79+
if (options.animation) {
8080

81-
$this.find(currentTab).animate( { opacity: 'show' }, 'slow', function() {
82-
$(this).trigger('_after');
83-
});
81+
$this.find(currentTab).animate( { opacity: 'show' }, 'slow', function() {
82+
$(this).trigger('_after');
83+
});
8484

85-
} else {
85+
} else {
8686

87-
$this.find(currentTab).show();
88-
$(this).trigger('_after');
87+
$this.find(currentTab).show();
88+
$(this).trigger('_after');
8989

90-
}
90+
}
9191

92-
return false;
92+
return false;
9393

94-
}
94+
}
9595

96-
);
96+
);
9797

98-
var init = eval("$this.find('> ul li')." + options.mouseevent + "(fn)");
98+
var init = eval("$this.find('> ul li')." + options.mouseevent + "(fn)");
9999

100-
init;
100+
init;
101101

102-
// Autorotate
103-
var elements = $this.find('> ul li'), i = options.active - 1; // ungly
102+
// Autorotate
103+
var elements = $this.find('> ul li'), i = options.active - 1; // ungly
104104

105-
var forward = function() {
105+
var forward = function() {
106106

107-
i = ++i % elements.length; // wrap around
107+
i = ++i % elements.length; // wrap around
108108

109-
options.mouseevent == 'hover' ? elements.eq(i).trigger('mouseover') : elements.eq(i).click();
109+
options.mouseevent == 'hover' ? elements.eq(i).trigger('mouseover') : elements.eq(i).click();
110110

111-
var t = setTimeout(forward, options.delay);
111+
var t = setTimeout(forward, options.delay);
112112

113-
$this.mouseover(function () {
113+
$this.mouseover(function () {
114114

115-
if (options.pauseonhover) clearTimeout(t);
115+
if (options.pauseonhover) clearTimeout(t);
116116

117-
});
117+
});
118118

119-
}
119+
}
120120

121-
if (options.autorotate) {
121+
if (options.autorotate) {
122122

123-
setTimeout(forward, 0);
123+
setTimeout(forward, 0);
124124

125-
if (options.pauseonhover) $this.on( "mouseleave", function() { setTimeout(forward, 1000); });
125+
if (options.pauseonhover) $this.on( "mouseleave", function() { setTimeout(forward, 1000); });
126126

127-
}
127+
}
128128

129-
var move = function(direction) {
129+
var move = function(direction) {
130130

131-
if (direction == 'forward') i = ++i % elements.length; // wrap around
131+
if (direction == 'forward') i = ++i % elements.length; // wrap around
132132

133-
if (direction == 'backward') i = --i % elements.length; // wrap around
133+
if (direction == 'backward') i = --i % elements.length; // wrap around
134134

135-
elements.eq(i).click();
135+
elements.eq(i).click();
136136

137-
}
137+
}
138138

139-
$this.find(options.controls.next).click(function() {
140-
move('forward');
141-
});
139+
$this.find(options.controls.next).click(function() {
140+
move('forward');
141+
});
142142

143-
$this.find(options.controls.prev).click(function() {
144-
move('backward');
145-
});
143+
$this.find(options.controls.prev).click(function() {
144+
move('backward');
145+
});
146146

147-
$this.on ('destroy', function() {
148-
$(this).removeData();
149-
});
147+
$this.on ('destroy', function() {
148+
$(this).removeData();
149+
});
150150

151-
}
151+
}
152152

153-
});
153+
});
154154

155-
};
155+
};
156156

157-
$(document).ready(function () { $('[data-toggle="tabslet"]').tabslet(); });
157+
$(document).ready(function () { $('[data-toggle="tabslet"]').tabslet(); });
158158

159159
})(jQuery);

jquery.tabslet.min.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* Tabs plugin
2+
* Tabslet | tabs jQuery plugin
33
*
44
* @copyright Copyright 2012, Dimitris Krestos
55
* @license Apache License, Version 2.0 (http://www.opensource.org/licenses/apache2.0.php)
6-
* @link http://vdw.staytuned.gr
6+
* @link http://vdw.staytuned.gr
77
* @version v1.4.2
88
*/
99

0 commit comments

Comments
 (0)