0
여기 내 문제를 설명하기위한 간단한 테스트입니다. 나는 iframe이를로드하는 페이지가 :jQuery가 Firefox iframe에서 잘못된 요소 높이를보고합니다.
iframe이 (box.html)이 하나의 스타일 사업부 포함
<html>
<head>
<title></title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js"></script>
</head>
<body>
<iframe id="iframe" src="box.html" style="width: 100px; height: 100px"></iframe>
<script>
$('#iframe').bind('load', function() {
var div = $(this).contents().find('div');
alert(div.height());
alert(div.innerHeight());
alert(div.outerHeight());
alert(div.outerHeight(true));
});
</script>
</body>
</html>
:
<html>
<head>
<title></title>
<style>
div {
height: 50px;
width: 50px;
margin: 5px;
padding: 5px;
border: 2px solid #00f;
background-color: #f00;
}
</style>
</head>
<body>
<div></div>
</body>
</html>
네 경고는 각각 64, 60, 50 반환 74해야한다을 . Safari 및 Chrome에서 예상대로 작동합니다. FF 3.5.1에서는 모두 64를 반환합니다. 이것은 잘못되었습니다.
누구나 FF/jQuery가 올바른 값을 반환하도록 할 수있는 방법을 알고 있습니까?