PDA

View Full Version : Need some help on menus



indianeditor
09-20-2006, 08:11 AM
I need some help. I wanna know how this is done:


Examples:


http://timesofindia.indiatimes.com/?in_leftnav

The block updates / most read


http://in.rediff.com/index.html

The block: Headlines / News / Business / Movies / Sports


This would be a good way to cut down on space and display all the top ten posts, top 10 comments, etc.


Is it some kind of Javascript?


Thanks.


Subir Ghosh

ronaldb66
09-20-2006, 01:09 PM
I didn't look at the first one because half the page came up as "forbidden"; the second one worked normally, though.

By the looks of it, yes; some function st2() is called with a different value for each tab. The function itself looks like this:

function st2(t){
for(i=1;i<=5;i++){
ts=document.getElementById('tt'+i);
tr = document.getElementById('dd'+i);
ta = document.getElementById('aa'+i);
if(t==i){
if(t==1) ts.className="tbheadline";
if(t==2) ts.className="tbnews";
if(t==3) ts.className="tbbusiness";
if(t==4) ts.className="tbmovies";
if(t==5) ts.className="tbsports";
ta.className="srchlinksel2";
ts.style.borderBottom="1px solid #FFFFFF";
tr.style["display"]="block";
tr.style["visibility"]="visible";
}
else{
ts.className="tb2";
ta.className="srchlink2";
ts.style.borderBottom="1px solid #B5D6EF";
tr.style["display"]="none";
tr.style["visibility"]="hidden";
}
}
}
On calling the function, the accompanying content is set to show and the tab to active, else the content is hidden and the tab set to inactive.