iframe在iPad上的大小 [英] iframe size on iPad

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

问题描述

我有一个HTML文件如下:

I have an HTML file as follows;

<table height="100%" cellspacing="0" cellpadding="0" border="0" width="646" class="data border">
            <tbody>
              <tr>
                <td valign="top" class="noPad">
                    <iframe height="100%" frameborder="0" width="100%" scrolling="no" name="studentFrame" src="delete2.html"></iframe>
                </td>
            </tr>
        </tbody>
</table>

iframe页面delete2.html有一个width = 846的表,即它比包含td width

The iframe page delete2.html has a table of width = 846 i.e. it is more than the containing td width

因此,这只会在页面加载和休止滚动上显示大约646个iframe内容的宽度。

So this only shows around 646 width of the iframe content on page load and rest scrolls..

但在iPad上,完整的846px的iframe内容被显示,它似乎流出表格宽度之外...它看起来破碎了。

But on the iPad, the complete 846px of iframe content gets displayed and it kind of appears to flow outside the table width..so it appears broken..

我如何修复这个问题?

推荐答案

从Safari iOS 4.2.1版本开始,强制显示iFrame的内容。如果您的iFrame的内容与外部网页位于相同的安全沙箱中,则可以使用div标记包围iframe,并使用该标记进行滚动。

Starting in version 4.2.1 of Safari iOS, and still going as of 4.3.3, the entire content of an iFrame is forcibly shown. If your iFrame's content is in the same security sandbox as the outer page, you can surround the iframe with a div tag and use that to do the scrolling.

因为安全沙箱限制,但如果两个网页具有相同的域,它应该找到工作: iPad iFrame单指滚动

This fiddle doesn't work because of security sandbox restrictions, but it should work find for you if both pages have the same domain: iPad iFrame single finger scrolling

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

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