I'm pretty new to coding particular to javascript, so sorry upfront for any dump ass questions.
what I'm trying to do is redesigning an template. I need to edit the length of the navigation tabs. I have a java script(tabs.js) which is automatically scaling the length of the tabs measured on the number of letters i guess. Question is how can I set the length of the tabs similar, even when the word changes in the number of letters.
This is the javascript
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;
});
Here is my html code
<header>
<nav>
<ul id="menu">
<li><a href="#!/page_Home"><span></span><strong>EVENTS</strong></a></li>
<li><a href="#!/page_About"><span></span><strong>HISTORY</strong></a></li>
<li><a href="#!/page_Portfolio"><span></span><strong>IMPRESSIONS</strong></a></li>
<li><a href="#!/page_Services"><span></span><strong>BOOKING</strong></a></li>
<li><a href="#!/page_Contact"><span></span><strong>CONTACT</strong></a></li>
</ul>
</nav>
</header>
Thank you in advance for your help!
I'm trying to recall something I read in the past....
.setTabSize(int Size)
I'm pretty sure that will help, or at least get you on the right track. Hopefully...
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.