被嵌页面代码:需要在页面body里加代码 例如:
<body MS_POSITIONING="GridLayout" οnlοad="window.clipboardData.setData('text',String(window.document.body.scrollHeight));">
主页面代码:
<iframe id="Price" name="Price"
src="http://topcars.cn/sina/AutoPriceDetails.aspx?000000"
width="950px" frameborder="0" scrolling="no"></iframe>
<script>
function resetIframeHeight(){
var str=window.clipboardData.getData('text');
var obj=document.getElementById('Price');
obj.style.height=parseInt(str)+'px';
window.clipboardData.setData('text',"");
}
</script>
样例页面:http://topcars.cn/sina/AutoPrice.aspx