我有一個iframe。我通過表單提交來設置iframe的內容(不同的域 - 比如www.google.com)。目前它的滾動屬性設置爲「否」。在IE中動態設置滾動到iframe
<iframe name="testFrame" id="testFrame" frameborder="1" scrolling="no" width="500" height="200"></iframe>
<form name="testForm" id="testForm" action="http://www.google.com" target="testFrame"></form>
<button name="testBtn" value="submit" onclick="submitForm();">submit</button>
我想要動態地滾動此iframe。
$("#testFrame").attr('scrolling','yes');
這是在Firefox中工作,但不在IE中。也試過用:
document.getElementById("testFrame").style.overflow="scroll";
沒有運氣... :(請幫助我......
儘管發表評論已經晚了,但你可以試試這個鏈接,http:// www。nazmulweb.com/works/Iframe/Dynamically_Set_Scrolling_in_Iframe.aspx – Hoque 2011-01-28 02:49:17