欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

利用js實(shí)現(xiàn)選項(xiàng)卡的特別效果的實(shí)例

 更新時(shí)間:2013年03月03日 16:02:35   投稿:shangke  
利用js實(shí)現(xiàn)選項(xiàng)卡的特別效果的實(shí)例,需要的朋友可以參考一下

復(fù)制代碼 代碼如下:

<html>
<head>
    <meta charset="utf-8"/>
    <style type="text/css">
        *{margin:0;padding:0;border:0}
        #main{width:300px;height:300px;background-color:green}
        #head{height:50px;background-color:red}
        #head li{float:left;list-style:none;height:50px;width:72px;text-align:center;line-height:50px;background-color:orange;margin-right:3px}
    </style>
</head>
<body>
    <div id="main">
    <div id="head">
    <ul>
        <li id="tab1" onclick="show(1)" style="background-color:green">新聞</li>
        <li id="tab2" onclick="show(2)">體育</li>
        <li id="tab3" onclick="show(3)">音樂</li>
        <li id="tab4" onclick="show(4)">娛樂</li>
    </ul>
    </div>
</body>
    <script>
        function show(n){
            for(var i=1;i<=4;i++){
            //先把所有的選項(xiàng)卡背景顏色設(shè)為橙色,內(nèi)容都隱藏
                document.getElementById("tab"+i).style.backgroundColor = 'orange';
                document.getElementById("p"+i).style.display = 'none';
            }
                document.getElementById("tab"+n).style.backgroundColor = 'green';
                document.getElementById("p"+n).style.display = "block";
        }

    </script>
</html>

相關(guān)文章

最新評(píng)論