0
我有一個jQuery腳本來調整容器內的所有div,但是當我重新加載頁面時,它在Google Chrome中無法正常工作。如果我調整瀏覽器寬度並重新加載頁面,則div會調整大小並使文本溢出div框。我怎樣才能解決這個問題?這裏是jQuery代碼:谷歌瀏覽器div在頁面加載溢出
<script type='text/javascript'>
function resizeDivs() {
$(".container>div").height("");
$('.container').each(function(){
var highestBox = 0;
$('.column', this).each(function(){
if($(this).height() > highestBox)
highestBox = $(this).height();
});
$('.column',this).height(highestBox);
});
}
$(document).ready(function(){
$(".container>div").css('height', 'auto');
resizeDivs();
});
$(window).resize(function() {
$(".container>div").css('height', 'auto');
resizeDivs();
});
</script>
它的偉大工程。謝謝。 – 2013-05-14 22:20:58