show不執(zhí)行,hide沒問題
<div class="apply_dialog" id="liuyanban">
? <div class="ad_content">
? ? <p class="formh1">請?zhí)顚懩男畔?lt;/p>
? ? <form id="apply_form" name='feedback' method='post' enctype='multipart/form-data' action='/e/enews/index.php'>
<input name='enews' type='hidden' value='AddFeedback'>
<input type=hidden name=bid value='1'>?
? ? ? <input placeholder="*姓名"? class="ad_name" name="title" id="name" type="text" >
? ? ? <input placeholder="*手機號" class="ad_phone" name="mycall" id="mycall" type="text">
? ? ? <input placeholder="*地區(qū)"? class="ad_phone" name="address" id="address" type="text">
? ? ? <textarea placeholder="*請描述您的需求,我們會盡快聯(lián)系您。" class="ad_note" style="margin-bottom: 13px;" name="saytext" id="content" cols="" rows="5"></textarea>
? ? ? <button? ?class="ad_submit" name="Submit3" type="submit">提交</button><input type="hidden" name="ecmsfrom" value="9">
? ? </form>
? ? <i class="ad_close" ></i>
? </div>
</div>
? ? ? ? <button>直接show動畫</button>
<button>直接hide動畫</button>
? ? <script type="text/javascript">
$('#liuyanban').css('border','red');
? ? //點擊button
? ? //執(zhí)行3秒隱藏
? ? //執(zhí)行3秒顯示
? ? $("button:first").click(function() {
? ? ? ? $("#liuyanban").show(3000)
? ? });
? ? $("button:last").click(function() {
? ? ? ? $("#liuyanban").hide(3000)
? ? });
? ? </script>
求大佬,為啥show不執(zhí)行,hide沒問題
2018-08-09
仔細看你的代碼,里面有三個button,你在js里為show()方法綁定的是button:first,第一個按鈕,但是你的第一個按鈕不是<button>直接show動畫</button>這個,而是<button? ?class="ad_submit" name="Submit3" type="submit">提交</button>這個提交按鈕,所以怎么會實現(xiàn)呢?為你的show按鈕加上id,就行了