我需要我的飞机飞上跑道(这是 map )并点击返回。到目前为止,它只会上升。 任何与 java script/html/jquery 相关的东西。请提供简单的建议。蒂^^ 这是我当前的代码::
<div class="Map"><div id="MovingPlane1"></div></div>
JS:
<script type="text/javascript">
$(document).ready(function(){
$("#MovingPlane1").click(function(){
$("#MovingPlane1").animate({bottom:"250px"},"slow");
});
});
<script>
最佳答案
jsBin demo
给你的飞机一个类 .plane
并使用这个代码:
$(".plane").click(function(){
$(this).animate({bottom:250},800,function(){
$(this).animate({bottom:0},800);
});
});
在动画回调中,您重做初始位置。
关于javascript - 需要将一个对象动画化到顶部并使其返回,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10775111/