更新时间: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});