0
非常容易,但有一些我錯過了......沒有在這裏工作。所以,如果我的第一個按鈕(ID =簡單)被選中,我的身體將有一個onload函數(resizeIframe)並把iframe.height 1200px,否則,如果我的其他按鈕被選中(codemandeur12),把iframe.height 1700px ..但沒有任何工作!將iframe.height放入if條件中
<script>
function resizeIframe(iframe) {
if (document.getElementById('iframe').contentWindow.document.getElementById('simple').checked) {
iframe.height = "1200px";
} else if (document.getElementById('iframe').contentWindow.document.getElementById('codemandeur12').checked) {
iframe.height = "1700px";
}
}
</script>
<iframe src="http://www.cbifinance.ca/form.php" scrolling="no" height="100%" onload="resizeIframe(this);" id="iframe">
Your browser does not support iframes.
</iframe>
我對沒有滾動條CSS:
<style type="text/css">
iframe {
overflow:hidden;
width:600px;
}
</style>
編輯:我是同一個網站/服務器上...
其實,我只是這樣做如下:功能resizeIframe(IFRAME){ iframe.height = 「1200像素」; }它的工作......看起來我真的不能從外面選擇一個單選按鈕的ID .. – user3038607