在ASP动态调整的iframe [英] resize iframe dynamically in ASP

查看:203
本文介绍了在ASP动态调整的iframe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要显示使用iFrame另一个页面内我的网页。

问题是,在iframe不会自动(高度)调整大小。

我怎么能自动调整呢?或者,也许有显示在另一个一页更好的办法?


解决方案

 的setInterval(函数(){
                VAR IFM =的document.getElementById(ifrmeID);
                VAR H = ifm.contentWindow.document.body.scrollHeight;
                ifm.height = H< 400? 400:H;
          },800);

400是默认的高度,如果你没有想要的iframe太短,800(MS)是频率,可以调整这两个值。把JS在你的网页,其中包含iframe。那么这将是确定的结束。

I want to display my page inside another page via Iframe.
The problem is that the iframe doesn't resize automatically (height).

How can I resize it automatically? Or maybe there is better way to display one page inside another?

解决方案

      setInterval(function() {
                var ifm = document.getElementById("ifrmeID");
                var h = ifm.contentWindow.document.body.scrollHeight;
                ifm.height = h < 400 ? 400 : h;
          }, 800);

400 is the default height if you didnt want iframe too short,800(ms) is frequency,you can adjust these two values. put the js in the end of your page which contained iframe .then it will be ok.

这篇关于在ASP动态调整的iframe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆