Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 42 additions & 4 deletions jquery.sliderTabs.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/*
* jQuery SliderTabs v1.1
* jQuery SliderTabs v1.2
* http://lopatin.github.com/sliderTabs
*
* Copyright 2012, Alex Lopatin
* Free to use under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*
* Edit By javad (www.mjm3d.com)
*/


Expand All @@ -15,6 +16,9 @@
*/
$.sliderTabs = function(container, options){
var plugin = this;

/* Add by javad */
var autoplayInterval;

var defaults = {
autoplay: false,
Expand Down Expand Up @@ -44,7 +48,11 @@
transition: 'slide',
transitionEasing: 'easeOutCubic',
transitionSpeed: 500,
width: null
width: null,

/* Add by javad */
mouseoverStop: true,
mouseleavePlay: true,
};

// jQuery objects of important elements
Expand Down Expand Up @@ -207,7 +215,7 @@

// Auto play
if(settings.autoplay)
setInterval(plugin.next, settings.autoplay);
autoplayInterval = setInterval(plugin.next, settings.autoplay);

// Panel arrows

Expand All @@ -219,6 +227,22 @@
plugin.prev();
return false;
});

/* Add by javad */
// Stop, if mouse over
if(settings.mouseoverStop) {
$container.mouseover(function() {
plugin.stop();
});
}

/* Add by javad */
// play, if mouse leave
if(settings.mouseleavePlay) {
$container.mouseleave(function() {
plugin.play();
});
}
}

/*
Expand Down Expand Up @@ -545,6 +569,20 @@
return height;
};

/* Add by javad */
// Play slider
plugin.play = function(speed){
if(!speed) speed = settings.autoplay;
if(speed) autoplayInterval = setInterval(plugin.next, speed);
}

/* Add by javad */
// Stop slider
plugin.stop = function(){
if(autoplayInterval)
clearInterval(autoplayInterval);
}


// Initialize the plugin
plugin.init();
Expand Down Expand Up @@ -827,4 +865,4 @@ function handler(event) {
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(function($,h,c){var a=$([]),e=$.resize=$.extend($.resize,{}),i,k="setTimeout",j="resize",d=j+"-special-event",b="delay",f="throttleWindow";e[b]=250;e[f]=true;$.event.special[j]={setup:function(){if(!e[f]&&this[k]){return false}var l=$(this);a=a.add(l);$.data(this,d,{w:l.width(),h:l.height()});if(a.length===1){g()}},teardown:function(){if(!e[f]&&this[k]){return false}var l=$(this);a=a.not(l);l.removeData(d);if(!a.length){clearTimeout(i)}},add:function(l){if(!e[f]&&this[k]){return false}var n;function m(s,o,p){var q=$(this),r=$.data(this,d);r.w=o!==c?o:q.width();r.h=p!==c?p:q.height();n.apply(this,arguments)}if($.isFunction(l)){n=l;return m}else{n=l.handler;l.handler=m}}};function g(){i=h[k](function(){a.each(function(){var n=$(this),m=n.width(),l=n.height(),o=$.data(this,d);if(m!==o.w||l!==o.h){n.trigger(j,[o.w=m,o.h=l])}});g()},e[b])}})(jQuery,this);
(function($,h,c){var a=$([]),e=$.resize=$.extend($.resize,{}),i,k="setTimeout",j="resize",d=j+"-special-event",b="delay",f="throttleWindow";e[b]=250;e[f]=true;$.event.special[j]={setup:function(){if(!e[f]&&this[k]){return false}var l=$(this);a=a.add(l);$.data(this,d,{w:l.width(),h:l.height()});if(a.length===1){g()}},teardown:function(){if(!e[f]&&this[k]){return false}var l=$(this);a=a.not(l);l.removeData(d);if(!a.length){clearTimeout(i)}},add:function(l){if(!e[f]&&this[k]){return false}var n;function m(s,o,p){var q=$(this),r=$.data(this,d);r.w=o!==c?o:q.width();r.h=p!==c?p:q.height();n.apply(this,arguments)}if($.isFunction(l)){n=l;return m}else{n=l.handler;l.handler=m}}};function g(){i=h[k](function(){a.each(function(){var n=$(this),m=n.width(),l=n.height(),o=$.data(this,d);if(m!==o.w||l!==o.h){n.trigger(j,[o.w=m,o.h=l])}});g()},e[b])}})(jQuery,this);