我有一些代码可以确保这两个带有 id 内容和 txtCotent 的 div 具有相同的高度。
<script language = "javascript" src = "js/jquery.js"></script>
<script>
$(document).ready(function () {
var h = $('#wrapContent#').css('height');
$('#content, #txtContent').css('height', h);
});
</script>
关于为什么这在 IE 中不起作用的任何想法?这是链接... http://students.uwf.edu/bmg17/workshop/index.cfm
最佳答案
$('#content, #txtContent').css('height', h);
h 应该等于 h + 'px'
您需要表示单位,在本例中,px = 像素。
关于jquery - 知道为什么这个 jquery 在 IE 中不起作用但在 firefox 中起作用吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5199803/