
filename.asp里面 <img src="<%=src%>" img其他参数>
使用iframe传递的参数,处理以后生成对应的图片源src
另外,可使用js
file.htm
<iframe id="f" src="filename.htm" iframe其他参数></iframe>
<script language=javascript>
var i=0
function s(){
var a=new Array('1.gif','2.gif','3.gif')
f.getElementsByTagName("img")[0].src=a[i%3]
return
}
</script>
<input onclick='s()' type=button value='click'>
filename.htm
<img src=1.gif img其他参数 />
第一种:<script type="text/javascript">
function reinitIframe(){
var iframe = document.getElementById("mainFrame")//id改为你的iframe的id
try{
var bHeight = iframe.contentWindow.document.body.scrollHeight
var dHeight = iframe.contentWindow.document.documentElement.scrollHeight
var height = Math.max(bHeight, dHeight)
iframe.height = height
}catch (ex){}
}
window.setInterval("reinitIframe()", 200)
</script>
第二种:
<script>
//IFrame自适应高度
function reinitIframe(){
var iframe = document.getElementById("infoshowiframeid")//IFRAME id
try{
var bHeight = iframe.contentWindow.document.body.scrollHeight
var dHeight = iframe.contentWindow.document.documentElement.scrollHeight
var height = Math.max(bHeight, dHeight)
iframe.height = Math.max(height,400)
// alert(height)
}catch (ex){}
}
window.setInterval("reinitIframe()", 200)
</script>
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)