且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

jQuery动画功能-隐藏和拉伸div

更新时间:2021-12-18 04:11:09

根据更新后的代码,您在#switch的空白处设置了200px的空白;

Per your updated code, you are setting the "left" of the #switch when you gave it a margin of 200px;

更改

$('#switch').animate({"left": 5});
$('#switch').animate({"left": 200});

$('#switch').animate({"margin-left": 5});
$('#switch').animate({"margin-left": 200});