简体   繁体   English

iOS 6:Safari溢出:隐藏在包含div上,当模态打开时不工作

[英]iOS 6: Safari overflow: hidden on containing div not working when modal open

I can't seem to use overflow: hidden trick on the body of my website in order to lock the background content when a modal is open. 我似乎无法使用overflow: hidden在我的网站主体上的技巧,以便在模态打开时锁定背景内容。

I'm applying the current styles onto the body: 我正在将当前样式应用到身体上:

    $('body').css({'overflow':'auto', 'position':'static'});

And they are being successfully applied, it works fine in Android, the background content locks, however in iOS devices, this doesn't work and the content background content is still scrollable. 并且它们正在成功应用,它在Android中运行良好,后台内容锁,但在iOS设备中,这不起作用,内容背景内容仍然可滚动。 Any idea what would cause this? 知道是什么会导致这个吗?

This is the meta viewport tag I am using: 这是我正在使用的元视口标记:

<meta name="viewport" content="width=device-width, maximum-scale=1">

iOS6 Webview requires overflow hidden on both the html and body element to work correctly. iOS6 Webview要求隐藏在htmlbody元素上的溢出才能正常工作。 If someone wants to add it to the webkit bug tracker I'd be much obliged :). 如果有人想将它添加到webkit bug跟踪器,我将非常感激:)。

Either this or the question here should be marked as duplicate. 此处此处的问题应标记为重复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM