<div class="codetitle"> <span><a style="CURSOR: pointer" data="98388" class="copybut" id="copybut98388" onclick="doCopy('code98388')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code98388"> <br><ul id="tabMainNav"> <br><li class="selected" id="tab_GameinfoNav" onmousemove="show_tab(0)"><span><a id="tab_1" href="#">{$PHPCMS[sitename]}</a></span></li> <br><li id="tab_ShareEmailNav" onmousemove="show_tab(1)"> <span><a id="tab_2" href="#">由 Email 分享</a></span> </li> <br><li id="tab_ShareIMNav" onmousemove="show_tab(2)"> <span><a id="tab_3" href="#">由 IM 分享</a></span> </li> <br><li id="tab_BlogNav" onmousemove="show_tab(3)"> <span><a id="tab_4" href="#">发布到博客/网站</a></span> </li> <br> </ul> <br><ul id="" tabcontent> <br><li> <br><li> <br><li> <br><li> <br> </ul> <br> </div> <br>JS代码 <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="90102" class="copybut" id="copybut90102" onclick="doCopy('code90102')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code90102"> <br><script language="javascript"> <BR>function show_tab(id){ <BR>var tabMainNav; <BR>var tabContent; <BR>tabMainNav=document.getElementById('tabMainNav'); <BR>tabContent=document.getElementById('tabContent'); <BR>for(i=0;i<tabMainNav.children.length;i++){ <BR>if(i==id){ <BR>tabMainNav.children[i].className='selected'; <BR>tabContent.children[i].className=''; <BR>}else{ <BR>tabMainNav.children[i].className=''; <BR>tabContent.children[i].className='hidden'; <BR>} <BR>} <BR>} <BR></script> <br> </div> <br>CSS代码,对这两个CSS修改一下就可以显示不同的样式了 <br>.hidden{ <br>} <br>.selected{ <br>} <br>