<!DOCTYPE html><html><head>? ? <meta http-equiv="Content-type" content="text/html; charset=utf-8" />? ? <title></title>? ? <style>? ? .left div,? ? .right div {? ? ? ? width: 100%;? ? ? ? height: 50px;? ? ? ? padding: 5px;? ? ? ? margin: 5px;? ? ? ? float: left;? ? ? ? border: 1px solid #ccc;? ? }? ??? ? .left div {? ? ? ? background: #bbffaa;? ? }? ??? ? .right div {? ? ? ? background: yellow;? ? }? ? </style>? ? <script src="http://libs.baidu.com/jquery/1.9.1/jquery.js"></script></head><body>? ? <h2>hide</h2>? ? <div class="left">? ? ? ? <h4>測試一</h4>? ? ? ? <div id="a1">hide操作</div>? ? ? ? <button>直接hide</button>? ? ? ? <script type="text/javascript">? ? ? ? //點(diǎn)擊buttom1 直接隱藏? ? ? ? $("button:first").click(function() {? ? ? ? ? ? $("#a1").hide()? ? ? ? });? ? ? ? ?$("button:first").click(function() {? ? ? ? ? ? if($("#a1").){}? ? ? ? });? ? ? ? </script>? ? ? ? <h4>測試一</h4>? ? ? ? <div id="a2">hide動畫操作</div>? ? ? ? <button>hide帶動畫</button>? ? ? ? <script type="text/javascript">? ? ? ? //點(diǎn)擊buttom2 執(zhí)行動畫隱藏? ? ? ? $("button:last").click(function() {? ? ? ? ? ? $("#a2").hide({? ? ? ? ? ? ? ? duration: 3000,? ? ? ? ? ? ? ? complete: function() {? ? ? ? ? ? ? ? ? ? alert('執(zhí)行3000ms動畫完畢')? ? ? ? ? ? ? ? }? ? ? ? ? ? })? ? ? ? });? ? ? ? </script>? ? </div></body></html>以上為代碼,我想問下這里當(dāng)我點(diǎn)擊隱藏之后,那么我的#a1這個元素,它到底是style.display=none,還是說它的width,height,opacity都為0?
1 回答
已采納

OlderSkee
TA貢獻(xiàn)123條經(jīng)驗(yàn) 獲得超103個贊
show hide 是操作display ,
slideup down 是操作寬高,
fadein out是操作透明度,
你可以看看jQuery 的api。
- 1 回答
- 0 關(guān)注
- 3331 瀏覽
添加回答
舉報
0/150
提交
取消