Blogger Information
Blog 3
fans 0
comment 0
visits 2030
Related recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
table切换
肖凌的博客
Original
678 people have browsed it

<!DOCTYPE html>
 <html>
 <head>
  <title></title>
  <link rel="stylesheet" type="text/css" href="style.css">
  <script type="text/javascript">
  window.onload=function(){
    var num=0;

    var noticeTit=document.getElementById('notice-tit');
    var noticeCon=document.getElementById('notice-con');
    var title=noticeTit.getElementsByTagName('li');
    var con=noticeCon.getElementsByClassName('sub_con');
    
    console.log(con[0]);
    function show(i){
     for(var j=0;j<con.length;j++){
      con[j].style.display='none';
      title[j].className='';
     }
     
     con[i].style.display='block';
     title[i].className='select';
    }
    for(var i=0;i<title.length;i++)
    {
     console.log(title.length);
     title[i].index=i;
     title[i].onmouseenter=function(){

      // show(this.index);
      show(this.index);
      clearInterval(timer);
     }
     console.log(title[1]);
    }
    function autoPlay(){
     if(num==title.length){num=0;}
     show(num);
     num++
    }

    timer=setInterval(autoPlay,1000);

  }

  </script>
 </head>
 <body>
   <div id="notice">
    <div id="notice-tit">
     <ul>
      <li>
       <a href="JavaScript:;">公告</a>
      </li>
      <li>
       <a href="JavaScript:;">规则</a>
      </li>
      <li>
       <a href="JavaScript:;">论坛</a>
      </li>
      <li>
       <a href="JavaScript:;">安全</a>
      </li>
      <li>
       <a href="JavaScript:;">公益</a>
      </li>
     </ul>
    </div>
    <div id="notice-con">
     <div class="sub_con" style="display:block">
      <ul>
       <li><a href="JavaScript:;">http://www.php.cn/live/1029.html</a></li>
       <li><a href="JavaScript:;">http://www.php.cn/live/1029.html</a></li>
       <li><a href="JavaScript:;">http://www.php.cn/live/1029.html</a></li>
       <li><a href="JavaScript:;">http://www.php.cn/live/1029.html</a></li>  
      </ul>
     </div>
     <div class="sub_con" style="display:none">
      <ul>
       <li><a href="JavaScript:;">http://www.php.cn/live/1030.html</a></li>
       <li><a href="JavaScript:;">http://www.php.cn/live/1030.html</a></li>
       <li><a href="JavaScript:;">http://www.php.cn/live/1030.html</a></li>
       <li><a href="JavaScript:;">http://www.php.cn/live/1030.html</a></li>  
      </ul>
     </div>
     <div class="sub_con" style="display:none">
      <ul>
       <li><a href="JavaScript:;">http://www.php.cn/live/1031.html</a></li>
       <li><a href="JavaScript:;">http://www.php.cn/live/1031.html</a></li>
       <li><a href="JavaScript:;">http://www.php.cn/live/1031.html</a></li>
       <li><a href="JavaScript:;">http://www.php.cn/live/1031.html</a></li>  
      </ul>
     </div>
     <div class="sub_con" style="display:none">
      <ul>
       <li><a href="JavaScript:;">http://www.php.cn/live/1032.html</a></li>
       <li><a href="JavaScript:;">http://www.php.cn/live/1032.html</a></li>
       <li><a href="JavaScript:;">http://www.php.cn/live/1032.html</a></li>
       <li><a href="JavaScript:;">http://www.php.cn/live/1032.html</a></li>  
      </ul>
     </div>     
     <div class="sub_con" style="display:none">
      <ul>
       <li><a href="JavaScript:;">http://www.php.cn/live/1033.html</a></li>
       <li><a href="JavaScript:;">http://www.php.cn/live/1033.html</a></li>
       <li><a href="JavaScript:;">http://www.php.cn/live/1033.html</a></li>
       <li><a href="JavaScript:;">http://www.php.cn/live/1033.html</a></li>  
      </ul>
     </div>               
    </div>

   </div>

 </body>
</html>

 

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post