用javascript修改了圆之后,如何修改呢? 这是我的 jQuery
$("#circle").hover(function(){
$(this).animate({width:"500px",
height:"500px",
borderRadius:"250px",
marginLeft:"300px",
marginTop:"200px"},1500);
},
function(){
$("#circle").css("width","200px");
});
最佳答案
我相信您问的是如何停止动画,以便当用户不再将鼠标悬停在元素上时可以成功重置其大小。您需要通过调用 $("#circle").stop(true, false)
手动停止动画,否则您在动画期间所做的任何更改都将被覆盖:
$("#circle").hover(function(){
$(this).animate({width:"500px",
height:"500px",
borderRadius:"250px",
marginLeft:"300px",
marginTop:"200px"},1500);
},
function(){
$("#circle").stop(true, false);
$("#circle").css("width","200px");
});
关于javascript - javascript修改后如何显示原来的圆?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38084427/