当我的iframe加载时,它的两个卷轴即将到来,如果我为iframe设置滚动到no,它将不会显示网站的完整内容 [英] When my iframe loads, its two scrolls are coming, if I set scrolling to no for iframe, it will not show complete content of website

查看:55
本文介绍了当我的iframe加载时,它的两个卷轴即将到来,如果我为iframe设置滚动到no,它将不会显示网站的完整内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有主站点A,我在站点A下的iframe中加载站点B.但是当站点B加载到站点A下时。它显示了两个卷轴。当我通过不滚动删除滚动时,其内容变为静态和固定大小。 altought site B有很多内容要显示。



我尝试过:



I have main site A and i am loading site B in iframe under site A. but when site B loads under site A. It is showing two scrolls. when i remove scroll by no scrolling, its content become static and fixed sized. altought site B has much content to show.

What I have tried:

<iframe src="http://siteB.com" style="border: 0; position:absolute; top:0; left:0; right:0; bottom:0; width:100%; height:100%">









我也试过javascript代码,但它不适用于我的情况。









I also tried javascript code, but its not working in my case.


<iframe id='myFrame' 



frameborder=0 scrolling=no width=100%  



src="..."

    onload='adjustMyFrameSize

();'> 
</iframe> 










<script>
 function adjustMyFrameHeight()
    {
        var frame = getElement

("myFrame");
        var frameDoc = getIFrameDocument

("myFrame");
        frame.height = frameDoc.body.offsetHeight;
    }
</script>

推荐答案

转到此处: HTML iframe滚动属性 [ ^ ]



底部注意:



Go to here: HTML iframe scrolling Attribute[^]

Note towards the bottom:

Syntax
<iframe scrolling="auto|yes|no">


Attribute   Values<pre>
Value       Description
auto        Scrollbars appear if needed (this is default)
yes         Scrollbars are always shown (even if they are not needed)
no          Scrollbars are never shown (even if they are needed)






所以 - 表现得如预期。




So - behaving as expected.


这篇关于当我的iframe加载时,它的两个卷轴即将到来,如果我为iframe设置滚动到no,它将不会显示网站的完整内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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