這裏是我的HTML單擊實際元素,開始動畫
<div id="test">There I dont want put button</div>
和我的CSS
#test { width: 300px; height: 100px; }
和腳本
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
$("#test").animate({height:300},"slow");
});
});
</script>
我怎樣才能激活此動畫無使用按鈕?我想點擊div #test
並將其設置爲300x300。我嘗試使用鏈接和標籤,但似乎點擊處理程序只理解按鈕單擊。
看看[這個問題](http://stackoverflow.com/questions/7636103/jquery-animation-on-window-load-on-an-infinite-loop)就是你在找的東西。 – Alex 2012-03-04 14:44:59