<div class="codetitle"> <span><a style="CURSOR: pointer" data="56910" class="copybut" id="copybut56910" onclick="doCopy('code56910')"><u>複製代碼</u></a></span> 代碼如下:</div> <div class="codebody" id="code56910"> <br>//W3C/1. Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <br><br> <br> <br> <title>Jquery的Tabs內容輪換效果實現程式碼,幾行搞定</title> <br><script language="javascript" type="text/javascript" src="/Scripts/jquery-1.4.4.min.js"></script> <br> <style type="text/css"> <BR> * { margin:0; padding:0} * { margin:0; padding:0} <; > body { font:12px Verdana, Geneva, sans-serif; color:#404040;} <BR> ); hidden; height:1%; height:160px;} <BR> .tabs span { z-index:2; font-size:12px; border:1px solid #d5d5d5; width:95px; border:1px solid #d5d5d5; width:95px; border:1px solid #d5d5d5; width:95px; border:1px solid #d5d5d5; width:95px; height:25px; ; float:left; margin-right:5px; cursor:pointer;} <BR> span.active { background-position:0 -25px; 02, #tab-03 { position:absolute; top:26px; left:0; width:338px; padding:10px; height:93px; border:1px solid #d5d5d5; z-index:1; ; -02, #tab-03 { display:none;} <BR> </style> <br> <script type="text/javascript"> <BR> $('.tabs span').mouseover(function () { <BR> //div隱藏<BR> //查找.tabs span同儕元素span後面緊鄰的同儕元素div $(this).siblings('span').removeClass('active').end().addClass('active').next('divremoveClass('active').end().addClass('active').next('divremoveClass('active').end().addClass('active').next('divremoveClass('active').end().addClass('active').next('divremoveClass('active').end().addClass('active').next('divremoveClass). ; <BR> }); <BR> }); <BR> ="tabs"> <BR> <!-- 預設第一個tab為啟動狀態--> <BR> <span class="active">熱點新聞 <BR> <div" id="tab-01">news</script> </div> <br> <span>娛樂新聞</span> <br> <div id="tab-02">enteriment</div> <div id=" tab-03">jobs</div> <br> <br> <br> <br><br>