IE를 싫어할 시간이 있다면, 바로 그 것입니다. 이 코드는 내용이있는 상자로 시작합니다. 버튼을 클릭하면 상자가 드롭 다운되고 페이드 인됩니다.이 jQuery 스 니펫을 Internet Explorer에서 작동시키는 방법은 무엇입니까?
<html>
<script type="text/javascript" src="jquery.js"></script>
<script type='text/javascript'>
function Test()
{
var item_height = $('#test').height();
$('#test').height(0);
$('#test').css('opacity','0');
$('#test').animate({ height: item_height, opacity: '1' },400);
}
</script>
<body>
<!-- The div below holds the sample content -->
<div id="test" style='border: 1px solid black;'>
Content<br>
Content<br>
Content<br>
Content<br>
Content
</div>
<!-- The button to test the animation -->
<br><br>
<div style='position: absolute; top: 150px; left: 10px;'>
<button onclick='Test();'>Test</button>
</div>
</body>
</html>
이 간단한 예제는 Chrome, Safari 및 Opera에서 작동합니다. 그러나 Internet Explorer? 아니요입니다.
IE에서 작동하도록 어떻게 해결할 수 있습니까?
이
변경? 어떤 IE에서 테스트 해 보았습니까? 필요한 '
'태그를 추가 했습니까? –그들이 중요하지 않다고 생각해서 나는 이것을 무시했습니다. DOCTYPE을 잊어 버렸습니다. –