Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need some help on menus

    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

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    JS alright

    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:
    Code:
    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.
    Last edited by ronaldb66; 09-20-2006 at 02:11 PM. Reason: Addition
    Regards,
    Ronald.
    ronaldvanderwijden.com


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •