parent
26cefcff3d
commit
76e62fb411
8 changed files with 606 additions and 516 deletions
File diff suppressed because one or more lines are too long
@ -0,0 +1,60 @@ |
|||||||
|
var EXPO = EXPO || {}; //isolated namespace
|
||||||
|
if (EXPO.about) { |
||||||
|
console.warn('WARNING: EXPO.eventsFeed is already defined!'); |
||||||
|
} else { |
||||||
|
EXPO.about = (function () { |
||||||
|
// variables
|
||||||
|
var that = {}; |
||||||
|
//default module setting
|
||||||
|
that.opt = {}; |
||||||
|
//dependence's
|
||||||
|
var com = EXPO.common; |
||||||
|
//private
|
||||||
|
var Tabs = function (options) { |
||||||
|
this.opt = options; |
||||||
|
var self = this, |
||||||
|
opt = this.opt, |
||||||
|
tabClass = opt.tabClass, |
||||||
|
activeClass = opt.activeClass; |
||||||
|
this.$tabsList = $('#'+opt.listId); |
||||||
|
this.$tabs = $('#'+opt.tabsId); |
||||||
|
this.$tabsOpenings = $('#'+opt.tabsOpeningId); |
||||||
|
|
||||||
|
$('a',this.$tabsList).on('click', function () { |
||||||
|
$(this).parent('li').addClass(activeClass).siblings().removeClass(activeClass); |
||||||
|
var tabId = $(this).attr('href'); |
||||||
|
tabId = tabId.replace('#',''); |
||||||
|
self.setActive(tabId); |
||||||
|
return false; |
||||||
|
}); |
||||||
|
|
||||||
|
|
||||||
|
}; |
||||||
|
Tabs.prototype = { |
||||||
|
initTabs: function () { |
||||||
|
|
||||||
|
}, |
||||||
|
setActive: function (tabId) { |
||||||
|
var activeClass = this.opt.activeClass, |
||||||
|
tabClass = this.opt.tabClass, |
||||||
|
postfix = this.opt.postfix; |
||||||
|
this.$tabs.children('.'+tabClass).hide().removeClass(activeClass); |
||||||
|
this.$tabs.children('#'+tabId).fadeIn(function () { |
||||||
|
$(this).addClass(activeClass) |
||||||
|
}); |
||||||
|
this.$tabsOpenings.children('.'+tabClass).removeClass(activeClass); |
||||||
|
this.$tabsOpenings.children('#'+tabId+postfix).addClass(activeClass); |
||||||
|
|
||||||
|
} |
||||||
|
}; |
||||||
|
that.init = function (options) { |
||||||
|
// settings extending
|
||||||
|
$.extend(this.opt, options); |
||||||
|
// begin of initialization
|
||||||
|
var self = this; |
||||||
|
this.tabs = new Tabs(this.opt.tabs); |
||||||
|
|
||||||
|
}; |
||||||
|
return that; |
||||||
|
}()); |
||||||
|
} |
||||||
@ -0,0 +1 @@ |
|||||||
|
var EXPO=EXPO||{};EXPO.about?console.warn("WARNING: EXPO.eventsFeed is already defined!"):EXPO.about=function(){var t={};t.opt={};var s=(EXPO.common,function(t){this.opt=t;var s=this,i=this.opt,a=(i.tabClass,i.activeClass);this.$tabsList=$("#"+i.listId),this.$tabs=$("#"+i.tabsId),this.$tabsOpenings=$("#"+i.tabsOpeningId),$("a",this.$tabsList).on("click",function(){$(this).parent("li").addClass(a).siblings().removeClass(a);var t=$(this).attr("href");return t=t.replace("#",""),s.setActive(t),!1})});return s.prototype={initTabs:function(){},setActive:function(t){var s=this.opt.activeClass,i=this.opt.tabClass,a=this.opt.postfix;this.$tabs.children("."+i).hide().removeClass(s),this.$tabs.children("#"+t).fadeIn(function(){$(this).addClass(s)}),this.$tabsOpenings.children("."+i).removeClass(s),this.$tabsOpenings.children("#"+t+a).addClass(s)}},t.init=function(t){$.extend(this.opt,t);this.tabs=new s(this.opt.tabs)},t}(); |
||||||
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue