Thursday, 22 August 2013

editing java script for dynamic tabs

editing java script for dynamic tabs

I'm pretty new to coding particular to javascript, so sorry upfront for
this newbie question.
what I'm trying to do is redesigning an template. I need to edit the tabs
length of the navigation menu. I have this java script which is
automatically scaling the length of the tab measured on the number of the
letters, I guess. Question is first: Is this the right script? Second: If
so, how can I set the length of the tabs similar, even when the word
changes in the number of letters. Thank you in advance for your help!
tabs = {
init : function(){
$('.tabs').each(function(){
var th=$(this),
tContent=$('.tab-content',th),
navA=$('.nav a',th)
tContent.not(tContent.eq(0)).hide()
navA.click(function(){
var th=$(this),
tmp=th.attr('href')
tContent.not($(tmp.slice(tmp.indexOf('#'))).fadeIn(1000)).hide()
$(th).parent().addClass('selected').siblings().removeClass('selected').find('span').stop().animate({opacity:'0'},600);
Cufon.refresh();
return false;
});
});
}
}

No comments:

Post a Comment