complete是必須的嗎?
<!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;
? ? }
? ? .dd{
? ? ? ? display: block;
? ? }
? ? </style>
? ? <script src="http://libs.baidu.com/jquery/1.9.1/jquery.js"></script>
</head>
<body>
? ? <h2>hide</h2>
? ? <div class="left">
? ? ? ? <h4>測(cè)試一</h4>
? ? ? ? <div id="a1">hide操作</div>
? ? ? ? <button>直接hide</button>
? ? ? ? <script type="text/javascript">
? ? ? ? //點(diǎn)擊buttom1 直接隱藏
? ? ? ? $("button:first").click(function() {
? ? ? ? ? ? $("#a1").hide()
? ? ? ? });
? ? ? ? </script>
? ? ? ? <h4>測(cè)試一</h4>
? ? ? ? <div id="a2">hide動(dòng)畫(huà)操作</div>
? ? ? ? <button class="dd">hide帶動(dòng)畫(huà)</button>
? ? ? ? <script type="text/javascript">
? ? ? ? //點(diǎn)擊buttom2 執(zhí)行動(dòng)畫(huà)隱藏
? ? ? ? $('button:last').click(function(){
? ? ? ? ? ? $('#a2').hide({
? ? ? ? ? ? ? ? duration:3000,
? ? ? ? ? ? ? ?com:function(){
? ? ? ? ? ? ? ? ? ? $('#a2').css('display','block')
? ? ? ? ? ? ? ? }
? ? ? ? ? ? })
? ? ? ? })
? ? ? ? </script>
? ? </div>
</body>
</html>
為什么我把complete改成com就顯示不了display:block,但是改成complete就可以,請(qǐng)問(wèn)complete是必須的嗎
2017-01-22
必須寫(xiě)complete,就像duration一樣,也可以完全不寫(xiě),如下: