gpt4 book ai didi

javascript - 在 iOS 设备上的 iframe 中填写表单时跳转页面

转载 作者:可可西里 更新时间:2023-11-01 06:01:37 24 4
gpt4 key购买 nike

我的 iOS 浏览器有问题

这是启动条件:
- 我们有一个简单的 html 页面,它包含 iframe
- iframe 还包含带有表单的简单 html 页面
- iframe 没有滚动并且它的大小是固定的

错误: 现在,如果我们要在 iPhone 上(从 Chrome/Safari 浏览器)打开这个页面并开始填写表格, 然后在打印文本的某个时刻,页面自行向下滚动

This is example link

<div id="container">

<iframe src="https://www.w3schools.com/php/demo_form_validation_complete.php" frameborder="0"></iframe>

</div>

为什么会这样?如何防止页面的这些自动“跳转”?

最佳答案

这可能有效:

HTML:

<div class="scroll-wrapper">
<iframe src=""></iframe>
</div>

CSS:

.scroll-wrapper {
-webkit-overflow-scrolling: touch;
overflow-y: scroll;

/* important: dimensions or positioning here! */
}

.scroll-wrapper iframe {
/* nada! */
}

来源:https://davidwalsh.name/scroll-iframes-ios

关于javascript - 在 iOS 设备上的 iframe 中填写表单时跳转页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43256782/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com