【发布时间】:2014-06-22 08:52:10
【问题描述】:
我已从 stackoverflow 中的其他答案中获取此代码。我成功地使用它从右到左制作动画
<head>
<style>
#toggle { width: 100px; height: 100px; background: #ccc; } </style>
<script src="jquery.min.js"></script>
<script src="jquery-ui.js"></script>
</head>
<body>
<p>Click anywhere to toggle the box.</p>
<div style="float:left;" id="toggle"></div>
<div style="width:30px; height:30px;float:left; background: #aaa;" id="handle"></div>
<script>
$(function() {
$('#handle').click(function() {
$('#toggle').animate({width: "100%"}, 1000);
});
});
</script>
但我想从左到右、从上到下、从下到上等制作动画。怎么做?
【问题讨论】:
标签: jquery jquery-animate