我正在使用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