新闻切片效果

Code:
  1. <html>  
  2. <head>  
  3. <style type="text/css">  
  4. body { text-align: center; margin:0; padding:0; background: #FFF; font-size:12px; color:#000;}   
  5. div,form,img,ul,ol,li,dl,dt,dd {margin: 0; padding: 0; border: 0;}   
  6. h1,h2,h3,h4,h5,h6 { margin:0; padding:0;}   
  7. table,td,tr,th{font-size:12px;}   
  8. a:link {color: #000; text-decoration:none;}   
  9. a:visited {color: #83006f;text-decoration:none;}   
  10. a:hover {color: #c00; text-decoration:underline;}   
  11. a:active {color: #000;}   
  12. .focusPic{margin:0 auto; width:244px;}   
  13. .focusPic .pic{margin:0 auto; width:240px; height:180px; padding:2px 0 0;}   
  14. .focusPic .adPic{margin:0 auto 5px; width:240px; height:29px; overflow:hidden;background:url(http://tech.163.com/newimg/adpic.gif);}   
  15. .focusPic .adPic .text{float:right; padding:9px 4px 0 0; width:140px;}   
  16. .focusPic .adPic .text a{color:#1f3a87;}   
  17. .focusPic .adPic .text a:hover{color:#bc2931;}   
  18. .focusPic h2{ float:left; width:232px;padding:4px 0 3px 12px; font-size:14px; text-align:left;}   
  19. .focusPic p{float:left; width:226px;line-height:160%; margin:0; text-align:left;padding:0 0 10px 12px;}   
  20. .focusPic p img {margin:0px 0 2px;}   
  21. .focusPic .more{ margin:0 auto; width:240px; }   
  22. .focusPic .more .textNum{float:right; margin:0 8px 0 0;padding:0 0 4px;}   
  23. .focusPic .more .textNum .text{float:left; font-weight:bold; padding:7px 6px 0 0; color:#666;}   
  24. .focusPic .more .textNum .num{float:left; width:113px; height:19px;}   
  25. .focusPic .more .textNum .bg1{ background:url(http://tech.163.com/newimg/num1.gif);}   
  26. .focusPic .more .textNum .bg2{ background:url(http://tech.163.com/newimg/num2.gif);}   
  27. .focusPic .more .textNum .bg3{ background:url(http://tech.163.com/newimg/num3.gif);}   
  28. .focusPic .more .textNum .bg4{ background:url(http://tech.163.com/newimg/num4.gif);}   
  29. .focusPic .more .textNum .num ul{ float:left; width:113px;}   
  30. .focusPic .more .textNum .num li{float:left; width:28px; font-weight:bold;display:block; color:#fff; list-style-type:none; padding:6px 0 0;}   
  31. .focusPic .more .textNum .num li a{color:#fff; padding:0 5px; }   
  32. .focusPic .more .textNum .num li a:visited{color:#fff;}   
  33. .focusPic .more .textNum .num li a:hover{color:#ff0;}   
  34. </style>  
  35.  <script language="JavaScript" type="text/javascript">  
  36. var nn;   
  37. nn=1;   
  38. setTimeout('change_img()',6000);   
  39. function change_img()   
  40. {   
  41.  if(nn>4) nn=1  
  42.  setTimeout('setFocus1('+nn+')',6000);   
  43.  nn++;   
  44.  tt=setTimeout('change_img()',6000);   
  45. }   
  46. function setFocus1(i)   
  47. {   
  48.  selectLayer1(i);   
  49. }   
  50. function selectLayer1(i)   
  51. {   
  52.  switch(i)   
  53.  {   
  54.  case 1:   
  55.  document.getElementById("focusPic1").style.display="block";   
  56.  document.getElementById("focusPic2").style.display="none";   
  57.  document.getElementById("focusPic3").style.display="none";   
  58.  document.getElementById("focusPic4").style.display="none";   
  59.  document.getElementById("focusPic1nav").style.display="block";   
  60.  document.getElementById("focusPic2nav").style.display="none";   
  61.  document.getElementById("focusPic3nav").style.display="none";   
  62.  document.getElementById("focusPic4nav").style.display="none";   
  63.  break;   
  64.  case 2:   
  65.  document.getElementById("focusPic1").style.display="none";   
  66.  document.getElementById("focusPic2").style.display="block";   
  67.  document.getElementById("focusPic3").style.display="none";   
  68.  document.getElementById("focusPic4").style.display="none";   
  69.  document.getElementById("focusPic1nav").style.display="none";   
  70.  document.getElementById("focusPic2nav").style.display="block";   
  71.  document.getElementById("focusPic3nav").style.display="none";   
  72.  document.getElementById("focusPic4nav").style.display="none";   
  73.  break;   
  74.  case 3:   
  75.  document.getElementById("focusPic1").style.display="none";   
  76.  document.getElementById("focusPic2").style.display="none";   
  77.  document.getElementById("focusPic3").style.display="block";   
  78.  document.getElementById("focusPic4").style.display="none";   
  79.  document.getElementById("focusPic1nav").style.display="none";   
  80.  document.getElementById("focusPic2nav").style.display="none";   
  81.  document.getElementById("focusPic3nav").style.display="block";   
  82.  document.getElementById("focusPic4nav").style.display="none";   
  83.  break;   
  84.  case 4:   
  85.  document.getElementById("focusPic1").style.display="none";   
  86.  document.getElementById("focusPic2").style.display="none";   
  87.  document.getElementById("focusPic3").style.display="none";   
  88.  document.getElementById("focusPic4").style.display="block";   
  89.  document.getElementById("focusPic1nav").style.display="none";   
  90.  document.getElementById("focusPic2nav").style.display="none";   
  91.  document.getElementById("focusPic3nav").style.display="none";   
  92.  document.getElementById("focusPic4nav").style.display="block";   
  93.  break;   
  94.  }   
  95. }   
  96. </script>  
  97. </head>  
  98.   
  99. <body>  
  100.  <div class="focusPic">  
  101.  <div id="focusPic1" style="display:block ;">  
  102.  <div class="pic"> <a href="http://tech.163.com/special/000915SN/soft2005.html"><img src="http://cimg.163.com/tech/2006/1/18/2006011810122068706.jpg" alt="网易学院05年软件评选结果" width="240" height="180" border="0" /></a> </div>  
  103.  <h2><a href="http://tech.163.com/special/000915SN/soft2005.html">网易学院05年软件评选结果</a></h2>  
  104.  <p>经过大家的热情投票和我们的辛劳整理,网易学院2005年年度软件评选结果终于出炉啦。点击进入查看……<img src="/newimg/i2.gif" alt="详细" width="3" height="5" /> <a href="http://tech.163.com/special/000915SN/soft2005.html" class="cDRed">详细</a></p>  
  105.  </div>  
  106.  <div id="focusPic2" style="display: none ;">  
  107.  <div class="pic"> <a href="http://tech.163.com/discover/"><img src="http://cimg.163.com/tech/2006/1/17/200601171557008cee7.jpg" alt="颠覆丛林动物生存法则" width="240" height="180" border="0" /></a> </div>  
  108.  <h2><a href="http://tech.163.com/discover/">颠覆丛林动物生存法则</a></h2>  
  109.  <p>群居动物的这种行为颠覆了我们通常认为的,在动物世界通行的 “丛林法则”,动物不都自私,不都是弱肉强食的。<img src="/newimg/i2.gif" alt="详细" width="3" height="5" /> <a href="http://tech.163.com/discover/" class="cDRed">详细</a></p>  
  110.  </div>  
  111.  <div id="focusPic3" style="display: none ;">  
  112.  <div class="pic"> <a href="http://tech.163.com/special/00091MNJ/itobserve015.html"><img src="http://cimg.163.com/tech/2006/1/17/2006011711483290a60.jpg" alt="WAPI并非贸易阴谋" width="240" height="180" border="0" /></a> </div>  
  113.  <h2><a href="http://tech.163.com/special/00091MNJ/itobserve015.html">WAPI并非贸易阴谋</a></h2>  
  114.  <p>近日国家做出决定:“将向其他的国内及国外企业公布该算法”。事实证明中国WAPI标准并非是贸易阴谋。<img src="/newimg/i2.gif" alt="详细" width="3" height="5" /> <a href="http://tech.163.com/special/00091MNJ/itobserve015.html" class="cDRed">详细</a></p>  
  115.  </div>  
  116.  <div id="focusPic4" style="display: none ;">  
  117.  <div class="pic"> <a href="http://tech.163.com/special/00091OSI/horizons.html"><img src="http://cimg.163.com/tech/2006/1/17/200601171002503f251.jpg" alt="新视野号探测冥王星特别专题" width="240" height="180" border="0" /></a> </div>  
  118.  <h2><a href="http://tech.163.com/special/00091OSI/horizons.html">新视野号探测冥王星特别专题</a></h2>  
  119.  <p>美国宇航局将于北京时间18日凌晨2时24分发射新视野号探测器,造访这颗人类唯一尚未探测过的行星-冥王星。<img src="/newimg/i2.gif" alt="详细" width="3" height="5" /> <a href="http://tech.163.com/special/00091OSI/horizons.html" class="cDRed">详细</a></p>  
  120.  </div>  
  121.  <div class="more">  
  122.  <div class="textNum">  
  123.  <div class="text">> 更多头图新闻</div>  
  124.  <div class="num bg1" id="focusPic1nav" style="display: block;">  
  125.  <ul>  
  126.  <li>1</li>  
  127.  <li><a href="javascript:setFocus1(2);" target="_self">2</a></li>  
  128.  <li><a href="javascript:setFocus1(3);" target="_self">3</a></li>  
  129.  <li><a href="javascript:setFocus1(4);" target="_self">4</a></li>  
  130.  </ul>  
  131.  </div>  
  132.  <div class="num bg2" id="focusPic2nav" style="display: none;">  
  133.  <ul>  
  134.  <li><a href="javascript:setFocus1(1);" target="_self">1</a></li>  
  135.  <li>2</li>  
  136.  <li><a href="javascript:setFocus1(3);" target="_self">3</a></li>  
  137.  <li><a href="javascript:setFocus1(4);" target="_self">4</a></li>  
  138.  </ul>  
  139.  </div>  
  140.  <div class="num bg3" id="focusPic3nav" style="display: none;">  
  141.  <ul>  
  142.  <li><a href="javascript:setFocus1(1);" target="_self">1</a></li>  
  143.  <li><a href="javascript:setFocus1(2);" target="_self">2</a></li>  
  144.  <li>3</li>  
  145.  <li><a href="javascript:setFocus1(4);" target="_self">4</a></li>  
  146.  </ul>  
  147.  </div>  
  148.  <div class="num bg4" id="focusPic4nav" style="display: none;">  
  149.  <ul>  
  150.  <li><a href="javascript:setFocus1(1);" target="_self">1</a></li>  
  151.  <li><a href="javascript:setFocus1(2);" target="_self">2</a></li>  
  152.  <li><a href="javascript:setFocus1(3);" target="_self">3</a></li>  
  153.  <li>4</li>  
  154.  </ul>  
  155.  </div>  
  156.  </div>  
  157.  </div>  
  158.  </div>  
  159.   
  160. </body>  
  161. </html>  

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值