我正在使用jQuery刷新容器DIV中的内容。当点击刷新链接时,我调用jQuery去除()内容DIV,然后加载()来重新创建它们和内容。jQuery remove()正在移动我的div块...我如何修复它们的位置?
问题是我有底部的菜单和导航,当我刷新内容时,在Ajax内容加载时DIV被remove()'d后,所有底部导航都会被暂时推上去。
HTML:
<div id="container">
<!-- Below PHP include generates contentdiv1 and contentdiv2 -->
<?php include($_SERVER['DOCUMENT_ROOT']."/content.php"); ?>
</div>
<div id="refresh">
<a href="javascript: void(0)" id="refreshbutton">Refresh</a>
</div>
<div id="bottomnav">
<!-- nav menus and copyright type junk here is getting pushed UP^^^ -->
</div>
JAVASCRIPT:
// This occurs when the "refresh" link is clicked
$('div#contentdiv1').remove();
$('div#contentdiv2').remove();
$('div#container').load('/content.php?rnd='+ Math.random()*999999);
所有帮助表示赞赏。谢谢
我猜#contentdiv1和#contentdiv2在#container里面? – PetersenDidIt 2010-01-30 03:30:37