Blogger Information
Blog 21
fans 0
comment 0
visits 20126
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
TAB切换与自动切换
电动机的博客
Original
912 people have browsed it

<!DOCTYPE html>
<html>
<head>
 <meta charset="utf-8">
 <title>TAB</title>
 <link rel="stylesheet" type="text/css" href="css/style.css">
 <!-- <script type="text/javascript" src="css/jquery-3.3.1.min.js"></script> -->

  
</head>
<body>
   <div id="notice" class="notice">
  <div id="notice-tit" class="notice-tit">
    <ul>
     <li class="select">
      <a href="#">公告</a>
     </li>
     <li>
      <a href="#">规则</a>
     </li>
     <li>
      <a href="#">论坛</a>
     </li>
     <li>
      <a href="#">安全</a>
     </li>
     <li>
      <a href="#">公益</a>
     </li>
    </ul>
  </div>
  <div id="notice-con" class="notice-con">
   <div class="mod" style="display:block">
    <ul>
     <li>
      <a href="#">
       曝范冰冰将参演好莱坞大片《355》曝范冰冰将参演好莱坞大片《355》
      </a>
     </li>
                    <li>
      <a href="#">
       美在台协会首次公开承认有美军进驻
      </a>
     </li>
     <li>
      <a href="#">
       消防员住地一排***祭战友
      </a>
     </li>
     <li>
      <a href="#">
       小米成立新公司经营范围包括房屋租赁
      </a>
     </li>
    </ul>
   </div>
            <div class="mod" style="display:none">
    <ul>
     <li>
      <span>
       [
                              <a href="#">通知</a>
       ]
      </span>
      <a href="#">
                          "滥发"即将换新
      </a>
     </li>
                    <li>
      <span>
       [
                              <a href="#">通知</a>
       ]
      </span>
      <a href="#">
                          比特币严管啦!
      </a>
     </li>
     <li>
      <span>
       [
                              <a href="#">通知</a>
       ]
      </span>
      <a href="#">
                          禁发商品名录!
      </a>
     </li>
                 <li>
      <span>
       [
                              <a href="#">通知</a>
       ]
      </span>
      <a href="#">
                          商品属性限制
      </a>
     </li>
    </ul>
   </div>
   <div class="mod" style="display:none">
    <ul>
     <li>
      <span>
       [
                              <a href="#">聚焦</a>
       ]
      </span>
      <a href="#">
                          金牌卖家再启航
      </a>
     </li>
                    <li>
      <span>
       [
                              <a href="#">功能</a>
       ]
      </span>
      <a href="#">
                          橱窗规则升级啦
      </a>
     </li>
     <li>
      <span>
       [
                              <a href="#">话题</a>
       ]
      </span>
      <a href="#">
                          又爱又恨优惠劵
      </a>
     </li>
                 <li>
      <span>
       [
                              <a href="#">工具</a>
       ]
      </span>
      <a href="#">
                          购后送店铺红
      </a>
     </li>
    </ul>
   </div>
            <div class="mod" style="display:none">
    <ul>
     <li>
      <a href="#">
                          个人重要信息要管牢!
      </a>
     </li>
                    <li>
      <a href="#">
                           卖家防范红包欺诈提醒
      </a>
     </li>
     <li>
      <a href="#">
                            更换收货地址的陷阱!
      </a>
     </li>
                 <li>
                        <a href="#">
                           注意***的技术升级了!
      </a>
     </li>
    </ul>
   </div>
            <div class="mod" style="display:none">
    <ul>
     <li>
      <a href="#">
                          走进无声课堂
      </a>
     </li>
                    <li>
      <a href="#">
                           淘宝之行大众评审赢公益金
      </a>
     </li>
     <li>
      <a href="#">
                            爱心***联合征集
      </a>
     </li>
                 <li>
                        <a href="#">
                           名公益机构淘宝开店攻略
      </a>
     </li>
    </ul>
   </div>
  </div>
 </div>
   <script type="text/javascript">
        var noticeTit=document.getElementById('notice-tit');
        var noticeCon=document.getElementById('notice-con');
        var title=noticeTit.getElementsByTagName('li');
        var con=noticeCon.getElementsByClassName('mod');
        var num=0;
        var timer=null;
        function autoplay(){
            num++;
            if(num==title.length){
             num=0;
            }
            showTab(num)
        }
          function showTab(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++){
           title[i].index=i;       //指定元素的位置从0开始
           title[i].onmouseenter=function(){
            clearInterval(timer);//清除定时时间
            showTab(this.index);
            num=this.index;
           }
           title[i].onmouseleave=function(){
            timer=setInterval(autoplay,4000)
           }
          }


   </script>
</body>
</html>

Correction status:Uncorrected

Teacher's comments:
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!