Difference between revisions of "User:Lexar/sandbox/Page.js"
< User:Lexar | sandbox
m |
m (weapon table concept 2) |
||
| Line 12: | Line 12: | ||
}, | }, | ||
init: function() { | init: function() { | ||
| − | var container = $('.weapon-grade-table'); | + | var container = $('.weapon-grade-table, .weapon-grade-table-2'); |
container.each(function(){ | container.each(function(){ | ||
var th = $(this), tabs = th.children('.tabs'), tab = tabs.children('li'), weapons = th.children('.weapons'), weapon = weapons.children('li'); | var th = $(this), tabs = th.children('.tabs'), tab = tabs.children('li'), weapons = th.children('.weapons'), weapon = weapons.children('li'); | ||
Revision as of 15:25, 4 July 2015
//my js page for general screwin around
$('head').append('<link href="https://dl.dropboxusercontent.com/u/32668357/wiki_stuff/tempres/style.css" rel="stylesheet" type="text/css" />');
var WeaponGradesTable = {
tabSwitch: function(th,tab,weapons,weapon) {
if (!th.hasClass('current')) {
var tabIndex = th.index();
th.parent().find('.current').removeClass('current');
th.addClass('current');
weapons.find('.current').removeClass('current');
weapon.eq(tabIndex).addClass('current');
}
},
init: function() {
var container = $('.weapon-grade-table, .weapon-grade-table-2');
container.each(function(){
var th = $(this), tabs = th.children('.tabs'), tab = tabs.children('li'), weapons = th.children('.weapons'), weapon = weapons.children('li');
tab.first().addClass('current');
weapon.first().addClass('current');
tab.click(function(){WeaponGradesTable.tabSwitch($(this),tab,weapons,weapon);});
});
//
}
};
$(WeaponGradesTable.init);