答案 0 :(得分:0)
使用顶部和左侧。
#wrapper {
left: 50%;
position: absolute;
margin-left: -223px /* half of width*/
}
然后使用:
动画div$('button[name="whattoput"]').click(function () {
$('div').animate({
left: "323px" // target position + left margin
});
});
答案 1 :(得分:0)
检查一下 请将#wrapper的位置设为亲戚
.hidestuff {
//display: none;
}
#wrapper {
margin-left:auto;
margin-right:auto;
width: 445px;
position:relative;
}