Removed 'Tab' suffix, tabs-content li's are now hidden by JavaScript instead of CSS.
This commit is contained in:
parent
c96423f56e
commit
82380d5c2d
@ -84,6 +84,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
swapClass : function(element, from, to){
|
||||||
|
Skeleton.removeClass(element, from);
|
||||||
|
Skeleton.addClass(element, to);
|
||||||
|
},
|
||||||
|
|
||||||
addListener : function(element, on, fn, last){
|
addListener : function(element, on, fn, last){
|
||||||
last = (last || false);
|
last = (last || false);
|
||||||
var BH;
|
var BH;
|
||||||
@ -110,8 +115,10 @@
|
|||||||
tabList = tabs[tabNum].getElementsByTagName("li");
|
tabList = tabs[tabNum].getElementsByTagName("li");
|
||||||
|
|
||||||
for(var k = 0, l = tabList.length; k < l; k++){
|
for(var k = 0, l = tabList.length; k < l; k++){
|
||||||
|
Skeleton.addClass(document.getElementById(tabList[k].getElementsByTagName("a")[0].href.substr(tabList[k].getElementsByTagName("a")[0].href.indexOf("#") + 1)), "hidden");
|
||||||
|
|
||||||
Skeleton.addListener(tabList[k].getElementsByTagName("a")[0], "click", function(e){
|
Skeleton.addListener(tabList[k].getElementsByTagName("a")[0], "click", function(e){
|
||||||
var contentLocation = this.href.substr(this.href.indexOf("#")) + "Tab",
|
var contentLocation = this.href.substr(this.href.indexOf("#")),
|
||||||
contentElement,
|
contentElement,
|
||||||
siblings;
|
siblings;
|
||||||
|
|
||||||
@ -130,12 +137,12 @@
|
|||||||
Skeleton.addClass(this, "active");
|
Skeleton.addClass(this, "active");
|
||||||
|
|
||||||
contentElement = document.getElementById(contentLocation.substr(1));
|
contentElement = document.getElementById(contentLocation.substr(1));
|
||||||
Skeleton.addClass(contentElement, "active");
|
Skeleton.swapClass(contentElement, "hidden", "active");
|
||||||
|
|
||||||
siblings = contentElement.parentNode.getElementsByTagName("li");
|
siblings = contentElement.parentNode.getElementsByTagName("li");
|
||||||
for(var m = 0, n = siblings.length; m < n; m++){
|
for(var m = 0, n = siblings.length; m < n; m++){
|
||||||
if(siblings[m] !== contentElement){
|
if(siblings[m] !== contentElement){
|
||||||
Skeleton.removeClass(siblings[m], "active");
|
Skeleton.swapClass(siblings[m], "active", "hidden");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -254,7 +254,7 @@
|
|||||||
border-top-right-radius: 2px; }
|
border-top-right-radius: 2px; }
|
||||||
|
|
||||||
ul.tabs-content { margin: 0; display: block; }
|
ul.tabs-content { margin: 0; display: block; }
|
||||||
ul.tabs-content > li { display:none; }
|
ul.tabs-content > li.hidden { display: hidden; }
|
||||||
ul.tabs-content > li.active { display: block; }
|
ul.tabs-content > li.active { display: block; }
|
||||||
|
|
||||||
/* Clearfixing tabs for beautiful stacking */
|
/* Clearfixing tabs for beautiful stacking */
|
||||||
|
Loading…
Reference in New Issue
Block a user