日期:2014-05-17  浏览次数:20437 次

求各位指点下这段代码是什么意思
 <script type="text/javascript">
        function setTab(name, cursel, n) {
            for (i = 1; i <= n; i++) {
                var menu = document.getElementById(name + i);
                var con = document.getElementById("con_" + name + "_" + i);
                menu.className = i == cursel ? "hover" : "";
                con.style.display = i == cursel ? "block" : "none";
            }
        }

    </script>
</head>
<body>
    <div class="z_main">

        <ul class="tab_m">
            <li id="qi1" onclick="setTab('qi',1,5)">1</li>
            <li id="qi2" onclick="setTab('qi',2,5)">2</li>
            <li id="qi3" onclick="setTab('qi',3,5)">3</li>
            <li id="qi4" onclick="setTab('qi',4,5)">4</li>
            <li id="qi5" onclick="setTab('qi',5,5)">5</li>

        </ul>
         <div class="tab_box" id="con_qi_1">1</div>
        <div class="tab_box" id="con_qi_2">2
            </div>
        <div class="tab_box" id="con_qi_3">3</div>
         <div class="tab_box" id="con_qi_4">4</div>
         <div class="tab_box" id="con_qi_5">5</div>
         <script>setTab('qi', 1, 5)</script>
    </div>
</body>

看别人在html中写的 但有点不是太懂  请各位指点一下