怎么點擊 “直接hide” 沒反應(yīng)?(已解決)
<!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"> ????????//點擊buttom1?直接隱藏 ????????$("button:first").click(function()?{ ????????????$("#a1").hide() ????????}); ????????</script> ????????<h4>測試一</h4> ????????<div?id="a2">hide動畫操作</div> ????????<button>hide帶動畫</button> ????????<script?type="text/javascript"> ????????//點擊buttom2?執(zhí)行動畫隱藏 ????????$("button:last").click(function()?{ ????????????$("#a2").hide({ ????????????????duration:?3000, ????????????????complete:?function()?{ ????????????????????alert('執(zhí)行3000ms動畫完畢') ????????????????} ????????????}) ????????}); ????????</script> ????</div> </body> </html>
有大佬知道嗎?
=========分割線==========
雖然我也不知道為什么我瀏覽器上沒用,但是把代碼復(fù)制到這里
http://www.w3school.com.cn/tiy/t.asp?f=jquery_manipulation_unwrap
就可以有效果了
2018-10-12
把<script src="http://libs.baidu.com/jquery/1.9.1/jquery.js"></script>改成
<script src="https://libs.baidu.com/jquery/1.9.1/jquery.js"></script>就可以在瀏覽器上運行了
2018-07-15
http://www.w3school.com.cn/tiy/t.asp?f=jquery_manipulation_unwrap
HTTP少了s
2018-02-10
好的懂了
2018-02-10
<h2>hide</h2>
????<div?class="left">
????????<h4>測試一</h4>
????????<div?id="a1">hide操作</div>
????????<button>直接hide</button>
他后面少一個這 ---------------------</div>