我不能修復小時後this problem - 網頁時通過jquery.load
加載,文本框下降,並向左移動圖像旁邊時,我使用jquery.animate
使滑動從左到右的影響。文本灰色框不應該丟失,因爲我已將它設置爲在css中左移。jQuery的:佈局問題,當負載和動畫頁面
這裏是jQuery的,
$('.block-item').click(function(){
$('#container-article').remove();
// Create a div after the parent clicked element.
$(this).after('<div id="container-article"></div>');
// Set the div to a variable and set its css.
var container_article = $('#container-article').css({
float:'left',
width:0
});
// Load the article into container_article.
container_article.load('article-3.php', function(){
$(this).animate({
width:800
},500);
});
return false;
});
的CSS,
.block-item {
width:50px;
height:500px;
display:block;
float:left;
background:#fff;
overflow:hidden;
cursor:pointer;
border:1px solid #000;
}
#article-content {
width:500px;
height:500px;
background:#ccc;
overflow:hidden;
}
#image-content {
float:left;
}
的HTML,
<div class="block-item"></div>
<div class="block-item"></div>
<div class="block-item"></div>
<div class="block-item"></div>
<div class="block-item"></div>
<div class="block-item"></div>
<div class="block-item"></div>
加載頁面,
<!-- binder-article -->
<div id="binder-article">
<div id="image-content"><img src="pic-2.jpg"/></div>
<!-- article-right -->
<div id="article-content">
<p>In Kaduna in Nigeria, a hotbed of Christian-Muslim conflict, Imam Ashafa and Pastor James led warring militias against each other. In pitched battles, Imam Ashafa's cousing was killed and Pastor James' hand was cut off. Ready to kill each other, they were suddenly overwhelmed by the power of their faith. Now best friends, they lead interfaith efforts in Nigeria and across the world. This film shares their amazing story...</p>
<p>In Kaduna in Nigeria, a hotbed of Christian-Muslim conflict, Imam Ashafa and Pastor James led warring militias against each other. In pitched battles, Imam Ashafa's cousing was killed and Pastor James' hand was cut off. Ready to kill each other, they were suddenly overwhelmed by the power of their faith. Now best friends, they lead interfaith efforts in Nigeria and across the world. This film shares their amazing story...</p>
</div>
<!-- article-right -->
</div>
我該如何解決它?
或者其他比animate
更好的jquery功能?
謝謝。
您是否嘗試過在'binder-article'上設置高度或者可能是nowrap? – 2011-05-16 02:00:59
是的,但是仍然一樣... – laukok 2011-05-16 02:03:12