中文(繁体)
網頁特效代碼,網易學院的新聞圖片切換特效,有文字詳細說明,還能自動切換
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3. org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content ="text/html; charset=gb2312" /> <title>新聞切換技術</title> <style type="text/css"> <!-- body { text-align: center; margin:0; padding: 0; background: #FFF; font-size:12px; color:#000;} div,form,img,ul,ol,li,dl,dt,dd {margin: 0; padding: 0; border: 0;} h1,h2,h3,h4,h5,h6 { margin:0; padding:0;} table,td,tr,th{font-size:12px;} a:link {color: #000; text-decoration:none ;} a:visited {color: #83006f;text-decoration:none;} a:hover {color: #c00; text-decoration:underline;} a:active {color: #000;} .focusPic{margin:0 auto; width:244px;} .focusPic .pic{margin:0 auto; width:240px; height:180px; padding:2px 0 0;} .focusPic .adPic{margin:0 auto 5px; ; overflow:hidden;background:url(/u/info_img/2009-06/20/4147_adpic.gif);} .focusPic .adPic .text{float:right; padding:9px 4px 0 0; width:140px; focusPic .adPic .text a{color:#1f3a87;} .focusPic .adPic .text a:hover{color:#bc2931;} .focusPic h2{ float:left; width:232px;}ding:4px 10 3px; size:14px; text-align:left;} .focusPic p{float:left; width:226px;line-height:160%; margin:0; text-align:left;padding:0 0 10px 12px; p img {margin:0px 0 2px;} .focusPic .more{ margin:0 auto; width:240px; } .focusPic .more .textNum{float:right; margin:0 8px 0 0;padding:0}0 4px; .focusPic .more .textNum .text{float:left; font-weight:bold; padding:7px 6px 0 0; color:#666;} .focusPic .more .textNum .num{float:left; width:1133; :19px;} .focusPic .more .textNum .bg1{ background:url(/u/info_img/2009-06/20/9415_num1.gif);} .focusPic .more .textNum .bg2{ background:url(/u/u info_img/2009-06/20/7390_num2.gif);} .focusPic .more .textNum .bg3{ background:url(/u/info_img/2009-06/20/5391_num3.gif); .bg4{ background:url(/u/info_img/2009-06/20/6709_num4.gif);} .focusPic .more .textNum .num ul{ float:left; width:113px;} .focusPic .more. num li{float:left; width:28px; font-weight:bold;display:block; color:#fff; list-style-type:none; padding:6px 0 0;} .focusPic .more .textNum .num litextNum .num li a{color:#fff; padding:0 5px; } .focusPic .more .textNum .num li a:visited{color:#fff;} .focusPic .more .textNum .num li a:hover{color:#ff0; } --> </style> </head> <body> <script language="JavaScript" type="text/javascript"> var nn; nn=1; setTimeout('change_img()',6000); function change_img () { if(nn>4) nn=1 setTimeout('setFocus1('+nn+')',6000); nn++; tt=setTimeout('change_img()',6000); } function setFocus1(i) { selectLayer1 (i); } function selectLayer1(i) { switch(i) { case 1: document.getElementById("focusPic1").style.display="block"; document.getElementById("focusPic2").style.display=" none"; document.getElementById("focusPic3").style.display="none"; document.getElementById("focusPic4").style.display="none"; document.getElementById("focusPic1nav").style.display= "block"; document.getElementById("focusPic2nav").style.display="none"; document.getElementById("focusPic3nav").style.display="none"; document.getElementById("focusPic4nav").stylePic4nav"). ="none"; break; case 2: document.getElementById("focusPic1").style.display="none"; document.getElementById("focusPic2").style.display="block"; document.getElementById("focusPic3 ").style.display="none"; document.getElementById("focusPic4").style.display="none"; document.getElementById("focusPic1nav").style.display="none"; document.getElementById(" focusPic2nav").style.display="block"; document.getElementById("focusPic3nav").style.display="none"; document.getElementById("focusPic4nav").style.display="none"; break; case 3break; case 3 : document.getElementById("focusPic1").style.display="none"; document.getElementById("focusPic2").style.display="none"; document.getElementById("focusPic3").style.display="block "; document.getElementById("focusPic4").style.display="none"; document.getElementById("focusPic1nav").style.display="none"; document.getElementById("focusPic2nav").style.display=" none"; document.getElementById("focusPic3nav").style.display="block"; document.getElementById("focusPic4nav").style.display="none"; break; case 4: document.getElementById("focusPic1") .style.display="none"; document.getElementById("focusPic2").style.display="none"; document.getElementById("focusPic3").style.display="none"; document.getElementById("focusPic4" ).style.display="block"; document.getElementById("focusPic1nav").style.display="none"; document.getElementById("focusPic2nav").style.display="none"; document.getElementById("focusPic3nav("focusPic3nav("focusPic3nav("focusPic3nav("focusPic3, ").style.display="none"; document.getElementById("focusPic4nav").style.display="block"; break; } } </script> <div class="focusPic"> <div id="focusPic1 " style="display:block ;"> <div class="pic"> <a href="http://www.downcodes.com"><img src="/u/info_img/2009-06/20/ 7867_2006011810122068706.jpg" alt="網易學院05年軟體評選結果" width="240" height="180" border="0" /></a> </div> <h2><a href="http: //www.downcodes.com">網易學院05年軟體評選結果</a></h2> <p>經過大家的熱情投票和我們的辛勞整理,網易學院2005年年度軟體評選結果終於出爐啦。點擊進入查看…<img src="/newimg/i2.gif" alt="詳細" width="3" height="5" /> <a href="http://www.downcodes.com" class ="cDRed">詳細</a></p> </div> <div id="focusPic2" style="display: none ;"> <div class="pic"> <a href="http:/ /www.downcodes.com"><img src="/u/info_img/2009-06/20/5724_200601171557008cee7.jpg" alt="顛覆叢林動物生存法則" width="240" orderheight="180" borderheight="180" borderheight="180" borderheight="180" borderheight="180" borderheight="180" borderheight="180" borderheight="180" borderheight=" 0" /></a> </div> <h2><a href="http://www.downcodes.com">顛覆叢林動物生存法則</a></h2> <p>群居動物的這種行為顛覆了我們通常認為的,在動物世界通行的“叢林法則”,動物不都自私,不都是弱肉強食的。 <img src="/newimg/i2.gif" alt="詳細" width="3" height="5" /> <a href="http://www.downcodes.com" class="cDRed">詳細</a></p> </div> <div id="focusPic3" style="display: none ;"> <div class="pic"> <a href="http://www.downcodes. com"><img src="/u/info_img/2009-06/20/6541_2006011711483290a60.jpg" alt="WAPI/貿易陰謀" width="240" height="180" border="0" /></ a> </div> <h2><a href="http://www.downcodes.com">WAPI並非貿易陰謀</a></h2> <p>近日國家做出決定:「將向其他的國內及國外企業公佈該演算法」。事實證明中國WAPI標準並非是貿易陰謀。 <img src="/newimg/i2.gif" alt="詳細" width="3" height="5" /> <a href="http://www.downcodes.com" class="cDRed">詳細</a></p> </div> <div id="focusPic4" style="display: none ;"> <div class="pic"> <a href="http://www.downcodes. com"><img src="/u/info_img/2009-06/20/6650_200601171002503f251.jpg" alt="新視野號探測冥王星特別專題" width="240" height="180" border="00" ></a> </div> <h2><a href="http://www.downcodes.com">新視野號探測冥王星特別專題</a></h2> <p>美國宇航局將於北京時間18日凌晨2時24分發射新視野號探測器,造訪這顆人類唯一尚未偵測過的行星-冥王星。 <img src="/newimg/i2.gif" alt="詳細" width="3" height="5" /> <a href="http://www.downcodes.com" class="cDRed">詳細</a></p> </div> <div class="more"> <div class="textNum"> <div class="text">> 更多頭圖新聞</div> <div class="num bg1" id="focusPic1nav" style="display: block;"> <ul> <li>1</li> <li><a href="javascript:setFocus1(2);" target=" _self">2</a></li> <li><a href="javascript:setFocus1(3);" target="_self">3</a></li> <li><a href= "javascript:setFocus1(4);" target="_self">4</a></li> </ul> </div> <div class="num bg2" id="focusPic2nav" style="display: none;"> <ul> <li><a href="javascript:setFocus1(1);" target="_self">1</a></li> <li>2</li> <li>< a href="javascript:setFocus1(3);" target="_self">3</a></li> <li><a href="javascript:setFocus1(4);" target="_self">4 </a></li> </ul> </div> <div class="num bg3" id="focusPic3nav" style="display: none;"> <ul> <li><a href="javascript :setFocus1(1);" target="_self">1</a></li> <li><a href="javascript:setFocus1(2);" target="_self">2</a>< /li> <li>3</li> <li><a href="javascript:setFocus1(4);" target="_self">4</a></li> </ul> </div> <div class="num bg4" id="focusPic4nav" style="display: none;"> <ul> <li><a href="javascript:setFocus1(1);" target="_self">1</ a></li> <li><a href="javascript:setFocus1(2);" target="_self">2</a></li> <li><a href="javascript:setFocus1(3 );" target="_self">3</a></li> <li>4</li> </ul> </div> </div> </div> </div> </body> </html>