1. 程式人生 > >55 jQuery-佇列中的animate

55 jQuery-佇列中的animate

1.效果圖

在這裡插入圖片描述

2.HTML程式碼

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
    <title>55 jQuery-佇列中的animate</title>
    <style type="text/css">
           div{border:solid 1px #666;background-color:#eee;
               width:50px;height:50px;font-size:13px;padding:5px}
    </style>
</head>
<body>
	
	<div>佇列</div>	
              
<script src="../jquery.min.js"></script>
<script type="text/javascript">
	$(function(){
		//div塊單擊事件
		$("div").click(function(){
			//第一列
			$(this).animate({height:100}, "slow")
			//第二列
			.animate({width:100}, "slow")
			//第三列
			.animate({height:50}, "slow")
			//第四列
			.animate({width:50}, "slow");
		})
	})
</script>
</body>
</html>