我有一個包含div的iframe,稍後會顯示,最初使用類隱藏。當我從容器div中移除該類時,其中的所有內容都會顯示出來。但iframe內的文本框未顯示。iframe中隱藏的文本框在IE中顯示時不顯示
parent.htm
<style>
.hide
{
display: none;
}
</style>
<script>
function showSearchWindow(show) {
if (show) {
$('div.overlay').removeClass('hide');
}
else {
$('div.overlay').addClass('hide');
}
}
</script>
<form id="form1">
<div class='overlay hide'>
<input type="text" id='txt1' value='test1' />
<iframe id="frame" src="frame.htm"></iframe>
</div>
<input type="button" id='btnShow' value='Show' onclick='showSearchWindow(true)' />
<input type="button" id='btnHide' value='Hide' onclick='showSearchWindow(false)' />
</form>
frame.htm
//Reference to jQuery 1.4.1 js file
<form id="form1">
<input type="text" id='txt2' value='test'/>
</form>
當我點擊 'btnShow', 'txt1中' 顯示,但 'TXT2' 沒有顯示。 我沒有在IE 7,8和9.在其他主流瀏覽器工作正常。
我已經測試了這個代碼在我的IE8中,它工作正常。 – 2012-01-31 11:28:12
@ e-zinc是的,你是正確的。它從frame.htm – sajith 2012-02-01 07:23:59