最佳答案
你是说有点像这样吗?
如果是这样,使用position:absolute
。这样元素的位置就不会影响其他元素的位置。
编辑:根据您要执行的操作,relative
可能更好。
EDIT2:甚至比这更好的是,动态使用高度来确定将内容移动多远。这样您就不会被限制在固定高度。
$('#slidenav').animate({
top: '-'+$(this).height()
}, 200);
$('#open a').toggle(
function(){
$('#slidenav').animate({
top: '0'
}, 500);
},
function(){
$('#slidenav').animate({
top: '-4'+$(this).height()
}, 500);
});
关于jquery - 使div向下滑动而不向下推内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6037317/