<html><head><script type="text/javascript" src="/jquery/jquery.js"></script><script type="text/javascript">$(document).ready(function(){$("button").click(function(){$("p").hide(1000,function(){alert("The paragraph is now hidden");});});});</script></head><body><button type="button">Hide</button><p>This is a paragraph with little content.</p><p>This is a paragraph with little content.</p><p>This is a paragraph with little content.</p></body></html>callback函數(shù)alert()一共提示了三次,我想讓它只提示一次,需要如何修改代碼?有沒有可能通過one()來(lái)實(shí)現(xiàn)?
jquery 怎么讓callback函數(shù)只運(yùn)行一次
慕運(yùn)維8079593
2019-06-07 11:06:37