?
Current Path : /home1/savoy/sportsmeet.net/wp-content/themes/livesay/assets/js/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : /home1/savoy/sportsmeet.net/wp-content/themes/livesay/assets/js/jquery.responsiveTabs.min.js |
/* * Project: jquery.responsiveTabs.js * Description: A plugin that creates responsive tabs, optimized for all devices * Author: Jelle Kralt (jelle@jellekralt.nl) * Version: 1.4.0 * License: MIT */ !function(a,b,c){function e(b,c){this.element=b,this.$element=a(b),this.tabs=[],this.state="",this.rotateInterval=0,this.$queue=a({}),this.options=a.extend({},d,c),this.init()}var d={active:null,disabled:[],collapsible:"accordion",startCollapsed:!1,rotate:!1,setHash:!1,animation:"default",duration:500,activate:function(){},deactivate:function(){},load:function(){},activateState:function(){},classes:{stateDefault:"r-tabs-state-default",stateActive:"r-tabs-state-active",stateDisabled:"r-tabs-state-disabled",stateExcluded:"r-tabs-state-excluded",tab:"r-tabs-tab",anchor:"r-tabs-anchor",panel:"r-tabs-panel",accordionTitle:"r-tabs-accordion-title"}};e.prototype.init=function(){var c=this;this.tabs=this._loadElements(),this._loadClasses(),this._loadEvents(),a(b).on("resize",function(a){c._setState(a)}),a(b).on("hashchange",function(a){var d=c._getTabRefBySelector(b.location.hash),e=c._getTab(d);d>=0&&!e._ignoreHashChange&&!e.disabled&&c._openTab(a,c._getTab(d),!0)}),this.options.rotate!==!1&&this.startRotation(),this.$element.bind("tabs-activate",function(a,b){c.options.activate.call(this,a,b)}),this.$element.bind("tabs-deactivate",function(a,b){c.options.deactivate.call(this,a,b)}),this.$element.bind("tabs-activate-state",function(a,b){c.options.activateState.call(this,a,b)}),this.$element.bind("tabs-load",function(a){var e,d=c._getTabRefBySelector(b.location.hash);c._setState(a),c.options.startCollapsed===!0||"accordion"===c.options.startCollapsed&&"accordion"===c.state||(e=d>=0&&!c._getTab(d).disabled?c._getTab(d):c.options.active>0&&!c._getTab(c.options.active).disabled?c._getTab(c.options.active):c._getTab(0),c._openTab(a,e),c.options.load.call(this,a,e))}),this.$element.trigger("tabs-load")},e.prototype._loadElements=function(){var b=this,c=this.$element.children("ul"),d=[],e=0;return this.$element.addClass("r-tabs"),c.addClass("r-tabs-nav"),a("li",c).each(function(){var g,h,i,j,k,c=a(this),f=c.hasClass(b.options.classes.stateExcluded);if(!f){g=a("a",c),k=g.attr("href"),h=a(k),i=a("<div></div>").insertBefore(h),j=a("<a></a>").attr("href",k).html(g.html()).appendTo(i);var l={_ignoreHashChange:!1,id:e,disabled:a.inArray(e,b.options.disabled)!==-1,tab:a(this),anchor:a("a",c),panel:h,selector:k,accordionTab:i,accordionAnchor:j,active:!1};e++,d.push(l)}}),d},e.prototype._loadClasses=function(){for(var a=0;a<this.tabs.length;a++)this.tabs[a].tab.addClass(this.options.classes.stateDefault).addClass(this.options.classes.tab),this.tabs[a].anchor.addClass(this.options.classes.anchor),this.tabs[a].panel.addClass(this.options.classes.stateDefault).addClass(this.options.classes.panel),this.tabs[a].accordionTab.addClass(this.options.classes.accordionTitle),this.tabs[a].accordionAnchor.addClass(this.options.classes.anchor),this.tabs[a].disabled&&(this.tabs[a].tab.removeClass(this.options.classes.stateDefault).addClass(this.options.classes.stateDisabled),this.tabs[a].accordionTab.removeClass(this.options.classes.stateDefault).addClass(this.options.classes.stateDisabled))},e.prototype._loadEvents=function(){for(var a=this,c=function(c){var d=a._getCurrentTab(),e=c.data.tab;c.preventDefault(),e.disabled||(a.options.setHash&&(b.location.hash=e.selector),c.data.tab._ignoreHashChange=!0,(d!==e||a._isCollapisble())&&(a._closeTab(c,d),d===e&&a._isCollapisble()||a._openTab(c,e,!1,!0)))},d=0;d<this.tabs.length;d++)this.tabs[d].anchor.on("click",{tab:a.tabs[d]},c),this.tabs[d].accordionAnchor.on("click",{tab:a.tabs[d]},c)},e.prototype._setState=function(){var b=a("ul",this.$element),c=this.state;b.is(":visible")?this.state="tabs":this.state="accordion",this.state!==c&&this.$element.trigger("tabs-activate-state",{oldState:c,newState:this.state})},e.prototype._openTab=function(a,b,c,d){var e=this;c&&this._closeTab(a,this._getCurrentTab()),d&&this.rotateInterval>0&&this.stopRotation(),b.active=!0,b.tab.removeClass(e.options.classes.stateDefault).addClass(e.options.classes.stateActive),b.accordionTab.removeClass(e.options.classes.stateDefault).addClass(e.options.classes.stateActive),e._doTransition(b.panel,e.options.animation,"open",function(){b.panel.removeClass(e.options.classes.stateDefault).addClass(e.options.classes.stateActive)}),this.$element.trigger("tabs-activate",b)},e.prototype._closeTab=function(a,b){var d=this;b!==c&&(b.active=!1,b.tab.removeClass(d.options.classes.stateActive).addClass(d.options.classes.stateDefault),d._doTransition(b.panel,d.options.animation,"close",function(){b.accordionTab.removeClass(d.options.classes.stateActive).addClass(d.options.classes.stateDefault),b.panel.removeClass(d.options.classes.stateActive).addClass(d.options.classes.stateDefault)},!0),this.$element.trigger("tabs-deactivate",b))},e.prototype._doTransition=function(a,b,c,d,e){var f,g=this;switch(b){case"slide":f="open"===c?"slideDown":"slideUp";break;case"fade":f="open"===c?"fadeIn":"fadeOut";break;default:f="open"===c?"show":"hide",g.options.duration=0}this.$queue.queue("responsive-tabs",function(e){a[f]({duration:g.options.duration,complete:function(){d.call(a,b,c),e()}})}),("open"===c||e)&&this.$queue.dequeue("responsive-tabs")},e.prototype._isCollapisble=function(){return"boolean"==typeof this.options.collapsible&&this.options.collapsible||"string"==typeof this.options.collapsible&&this.options.collapsible===this.getState()},e.prototype._getTab=function(a){return this.tabs[a]},e.prototype._getTabRefBySelector=function(a){for(var b=0;b<this.tabs.length;b++)if(this.tabs[b].selector===a)return b;return-1},e.prototype._getCurrentTab=function(){return this._getTab(this._getCurrentTabRef())},e.prototype._getNextTabRef=function(a){var b=a||this._getCurrentTabRef(),c=b===this.tabs.length-1?0:b+1;return this._getTab(c).disabled?this._getNextTabRef(c):c},e.prototype._getPreviousTabRef=function(){return 0===this._getCurrentTabRef()?this.tabs.length-1:this._getCurrentTabRef()-1},e.prototype._getCurrentTabRef=function(){for(var a=0;a<this.tabs.length;a++)if(this.tabs[a].active)return a;return-1},e.prototype.activate=function(a,b){var c=jQuery.Event("tabs-activate"),d=this._getTab(a);d.disabled||this._openTab(c,d,!0,b||!0)},e.prototype.deactivate=function(a){var b=jQuery.Event("tabs-dectivate"),c=this._getTab(a);c.disabled||this._closeTab(b,c)},e.prototype.getState=function(){return this.state},e.prototype.startRotation=function(b){var c=this;if(!(this.tabs.length>this.options.disabled.length))throw new Error("Rotation is not possible if all tabs are disabled");this.rotateInterval=setInterval(function(){var a=jQuery.Event("rotate");c._openTab(a,c._getTab(c._getNextTabRef()),!0)},b||(a.isNumeric(c.options.rotate)?c.options.rotate:4e3))},e.prototype.stopRotation=function(){b.clearInterval(this.rotateInterval),this.rotateInterval=0},a.fn.responsiveTabs=function(b){var d=arguments;return b===c||"object"==typeof b?this.each(function(){a.data(this,"responsivetabs")||a.data(this,"responsivetabs",new e(this,b))}):"string"==typeof b&&"_"!==b[0]&&"init"!==b?this.each(function(){var c=a.data(this,"responsivetabs");c instanceof e&&"function"==typeof c[b]&&c[b].apply(c,Array.prototype.slice.call(d,1)),"destroy"===b&&a.data(this,"responsivetabs",null)}):void 0}}(jQuery,window);