我有一個網頁,我通過ajax加載twitter feed。我的HTML和jQuery調用是這樣的:ajax請求後調整容器div
<body>
<div class="document-wrapper">
<div class="document">
<div class="content">
<div class="right-column">
<h2 class="twitter-header">Recent Tweets</h2>
<div class="twitter-feed" id="feed">
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
$('#feed').load("/Home/Twitter", '', showNewContent)
});
function showNewContent() {
}
</script>
</div>(document)
<div class="document-end"></div>
它正確地將結果存入進格,但沒有一個集裝箱的調整自己的身高和不良它溢出。所有的div都設置了height:auto;
,但這似乎什麼都不做。如果我在文檔類上設置了最小高度,它有點作品,但我不想在那裏靜態地有。
經過仔細檢查後,似乎文檔div正在調整大小,但它在調整大小時並未推動它下面的任何東西。頁腳留在原處,新內容呈現在其後面,並且不可選或任何其他內容。
有沒有辦法讓頁面在ajax調用後正確調整大小?
編輯:下面有一些CSS:
.footer-wrapper,
.document-wrapper {
width : 960px;
margin : 0 auto;
position : relative;
height : auto;
}
.document-wrapper { background : url(background-content.jpg) top repeat-y; }
.document {
padding : 0 35px 75px 35px;
height: auto;
}
.document-end {
height : 39px;
width : 960px;
margin : 0;
background : url(background-content-end.jpg) top no-repeat;
}
.right-column {
float : right;
width : 300px;
font-size : 90%;
position : relative;
left : -30px;
padding : 4px 0 0 0;
height: auto;
}
.twitter-feed
{
height:auto;
color : #ccc;
}
你會發布你的關聯的CSS? – ohmusama 2011-06-08 18:36:34
是否有父母使用'display:inline'? – 2011-06-08 18:37:10
沒有內聯。 CSS非常大,我不確定什麼是相關的。 – captncraig 2011-06-08 18:38:08