0
我有一個jQuery的Ajax調用更改div的內容,功能明智的一切工作正常,但是,當div被替換爲新的內容頁面得到小搖,和視圖位置得到改變了一點。下面給出了刷新的內容,我的意思是我在ajax調用後得到的html響應。jquery ajax刷新頁面內容
<div class="booksFrame">
<a href="Magazine/magazinedetail/magazine_id/3"><img src="XXXXXX" alt="Pachakuthira" title="Pachakuthira" /></a>
</div>
<div class="booksFrame">
<a href="Magazine/magazinedetail/magazine_id/43"><img src="XXXXXX" alt="Toms Classics" title="Toms Classics" /></a>
</div>
<div class="booksFrame">
<a href="Magazine/magazinedetail/magazine_id/34"><img src="XXXXXX" alt="The Sunday Indian (English)" title="The Sunday Indian (English)" /></a>
</div>
<div class="booksFrame">
<a href="Magazine/magazinedetail/magazine_id/26"><img src="XXXXXX" alt="Travel Plus" title="Travel Plus" /></a>
</div>
<div class="rightArrow"><img src="XXXXXX" alt="next" title="next" id="next2" onclick="javascript:nextTopseller(this);" /></div>
<input type="hidden" value="6" id="page_number_topseller" />
我的ajax調用函數。
function latestArrivalNext(next)
{
$("#previous").css("display", "block");
if($('#page_number').val())
{
page = Number($('#page_number').val());
page = page+1;
/*alert(page);*/
$("#ajax_container").html('<img src="/public/images/loading.gif" />').fadeIn('fast');
}
else
page = 2;
$.ajax
({
type: "POST",
url: "index/scrollnewrelease",
data: "page="+page,
success: function(msg)
{
/*alert(msg);*/
if(msg!=0)
{ /*alert(msg);*/
$("#ajax_container").html(msg).fadeIn('slow');
$("#previous").css("display", "block");
}else
$(next).css("display", "none");
}
});
}
你能證明你的JavaScript刷新內容? – 2012-04-17 05:27:27
@NiftyDude當然... – 2012-04-17 05:29:10