Blogger Information
Blog 17
fans 1
comment 1
visits 16504
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
Tab切换-自动
雷国恩的博客
Original
809 people have browsed it

<!doctype html>
<html lang="'en">
<head>
    <meta charset="UTF-8">
    <title>Tab切换-自动</title>
    <link type="text/css" rel="stylesheet" href="css/style.css">
    <script type="text/javascript">
    window.onload=function(){
     var num=0;
     var timer=null;
     var noticeTit=document.getElementById('notice-tit');
     var noticeCon=document.getElementById('notice-con');
     var title=noticeTit.getElementsByTagName('li');
     var con=noticeCon.getElementsByClassName('mod');
     for(var i=0;i<title.length;i++){
        title[i].index=i;
        title[i].onmouseenter=function(){
            clearInterval(timer);
            showTab(this.index);
            num=this.index;
        }
        title[i].onmouseleave=function(){
            timer=setInterval(autoplay, 1000);
        }
     }
     function showTab(a){
        for(var i=0;i<con.length;i++){
            con[i].style.display='none';
            title[i].className='';
        }
        con[a].style.display='block';
        title[a].className='select';
     }

     function autoplay(){
        num++;
        if(num==title.length){
            num=0;
        }
        showTab(num);
     }
    }
</script>
</head>
<body>
    <div id="notice">
        <div id="notice-tit">
          <ul>
            <li>
                <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">
            <div 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 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 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 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 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>
</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