[jQuery]¾Ö´Ï¸ÞÀÌ¼Ç È¿°ú ¸ØÃß±â - stop() |
|
|
![](icon/private_name/1.gif) |
8³â Àü |
<style type="text/css">
div {
position: absolute; background-color:#abc; left: 0px; top:50px;
width: 60px; height: 60px; margin: 5px;
}
</style>
<script src="../js/jquery-1.3.2-vsdoc2.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
// Start animation
$("#go").click(function () {
$(".block").animate({ left: '+=100px', top: '+=100px' }, 2000);
});
// Stop animation when button is clicked
$("#stop").click(function () {
$(".block").stop();
});
// Start animation in the opposite direction
$("#back").click(function () {
$(".block").animate({ left: '-=100px', top: '-=100px' }, 2000);
});
});
</script>
<button id="go">Go</button>
<button id="stop">STOP!</button>
<button id="back">Back</button>
<div class="block">
</div>
|
|
̵̧ : 282 |
̵̧
¸ñ·Ï
|
|