滑出是沒有問題的,我只對自己在那不滑的問題出現了,我覺得它沒有趕上他們的第一個IF寬度爲0像素。對不起,我真的很喜歡jQuery。問題滑入式輸入/輸出的JQuery
CODE:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#ShowHideComment").click(function(){
if ($(".iframe_comment").width() == "0px"){
$(".iframe_comment").animate({width: "800px"}, {queue:false, duration:1000});
}
else{
$(".iframe_comment").animate({width: "0px"}, {queue:false, duration:1000
});
}
});
});
</script>
哇涼的感謝託默勒格...我怎樣才能添加功能,當完成動畫?我嘗試添加功能(){在持續時間:1000。它不工作.. – user453089 2011-05-15 09:19:50
有一個'animate()'完整的參數。把你的回調函數放在那裏。另外,你真的不需要'queue:false'。只要沒有其他動畫已經開始,您的動畫將始終立即開始。 – Tomalak 2011-05-15 09:23:28
這裏我嘗試:'$ comment.animate({寬度:0},{隊列:假,持續時間:450,函數(){$ comment.hide()}});'然後不工作=/ – user453089 2011-05-15 09:28:20