菜单打开关闭效果

菜单打开关闭效果

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>菜单打开关闭</title>
<style type="text/css">
*{ margin:0px auto; padding:0px;}
.as{margin-top:50px; width:202px; height:52px;}
.zs{width:200px; height:50px; border:1px solid #000; text-align:center; vertical-align:middle; line-height:52px; background-color:#00F; margin-top:5px;}
.zs:hover{ cursor:pointer}
.a{ width:200px; height:50px; border:1px solid #000; text-align:center; vertical-align:middle; line-height:52px;  background-color:#00f;}
.bb{width:202px;height:160px; margin-left:0px; display:none;}
</style>
</head>

<body>
<div class="as">
    <div class="zs" οnclick="cc('ff')">00</div>
        <div class="bb" id="ff" sx="1">
            <div class="a">11</div>
            <div class="a">22</div>
            <div class="a">33</div>
        </div>
        <div class="zs" οnclick="cc('ff1')">00</div>
        <div class="bb" id="ff1" sx="1">
            <div class="a">11</div>
            <div class="a">22</div>
            <div class="a">33</div>
        </div>
        <div class="zs" οnclick="cc('ff2')">00</div>
        <div class="bb" id="ff2" sx="1">
            <div class="a">11</div>
            <div class="a">22</div>
            <div class="a">33</div>
        </div>
</div>

<script type="text/javascript">

function cc(id)
{
    var a1 = document.getElementById(id);
    if(a1.style.display=="block")
    {
        a1.style.display = "none";
        }else{
            a1.style.display = "block";
            }
    }
    
</script>
</body>
</html>

效果图:

 

转载于:https://www.cnblogs.com/Whitehat/p/8168939.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值