iOS Safari扩大了框架集大于视口 [英] iOS Safari expands frameset larger than viewport

查看:94
本文介绍了iOS Safari扩大了框架集大于视口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究一个包含水平分割框架集的网页;

 <!DOCTYPE html>一个菜单和一个内容区域的左侧边栏。 
< html>
< head>
< title> Frameset Test< / title>
< / head>

< frameset border =0cols =100,*>
< frame id =SideMenuname =SideMenusrc =SideMenu.htmlscrolling =no/>
< frame id =MainPagename =MainPagesrc =LongPageContent.htmlscrolling =auto/>
< / frameset>
< / html>

在桌面浏览器(包括Safari)中,框架集设置为视口大小和滚动条对于MainPage框架中的长页面内容显示。在iOS上的Safari中,框架集扩展为与MainPage框架中的内容相同的大小,并延伸到可见视口之外。



我希望以前的行为使页面无论MainPage中的内容如何,​​大小仍与视口相同。我已经调整了视口元标记,但调整视口不会修改框架集行为。



我知道Apple的iOS指南建议避免使用框架集,因为滚动更多令人困惑的(需要双指滚动的框架),但开除框架并不是一个好的选择。

Safari浏览器Web内容指南指出这是正常行为。该框架将扩大涵盖您的内容,你将无法滚动。



我很抱歉,但你将不得不丢弃帧。

您可以将边Nav编码到每个页面中(这很糟糕),也可以将一些东西放在PHP中,以便将SideMenu的内容动态加载到列中。

I'm working on a web page that has a frameset containing a horizontal split; a sidebar on the left for a menu and a content area.

<!DOCTYPE html>
<html>
<head>
    <title>Frameset Test</title>
</head>

<frameset border="0" cols="100,*">
    <frame id="SideMenu" name="SideMenu" src="SideMenu.html" scrolling="no" />
    <frame id="MainPage" name="MainPage" src="LongPageContent.html" scrolling="auto" />
</frameset>
</html>

In desktop browsers (including Safari), the frameset is set to the size of the viewport and a scrollbar appears for the long page content in the MainPage frame. In Safari on iOS, the frameset expands to the same size as the content in the MainPage frame, extending beyond the visible viewport.

I want the former behavior so that the page size remains the same as the viewport, regardless of the content in MainPage. I've fiddled around with the viewport meta tag, but adjusting the viewport does not modify the frameset behavior.

I know that Apple's iOS guidelines advise avoiding framesets since scrolling is more confusing (requiring two-finger scrolling in frames), but ditching the frames is not a great option.

解决方案

The safari Web Content Guide states that this is normal behavior. The frame will expand encompass your content and you will not be able to scroll.

I am sorry, but you are going to have to ditch the frames.

You can either code the side Nav into each page (which is terrible) or put something together in PHP that will load the contents of SideMenu dynamically into a column.

这篇关于iOS Safari扩大了框架集大于视口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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