在 iPad 上使用 Safari 自动滚动到页面顶部
我有一个 iPad 网站,当他们点击某个页面时,他们应该输入他们的电子邮件。当它们打开时,它会自动聚焦于输入并调出键盘。我的页面内容只有 373px,因为那是键盘上方的可视区域。我想阻止人们向下滚动到该点以下。有什么想法吗?当他们尝试向下滚动时会自动向后滚动的东西......?谢谢
您提供更多详细信息:我所拥有的是一页,其中有 3 张“幻灯片”。第一个高度为 768 像素,当他们单击“输入您的电子邮件进行注册”时,他们会转到幻灯片 2。这是我希望只有 373 像素高并防止滚动的幻灯片。我试过 $('#container').scrollTo( '768px', 500 ).css("height", "373px");
...这设置了高度,但是你'仍然可以向下滚动,它只显示一个大的白色框。
谢谢!
I have a site for ipads and when they click on a certain page they are supposed to input their email. When they open, it automatically onfocuses to the input and the keyboard is brought up. The content of my page is only 373px because that is the viewable area above the keyboard. I'd like to prevent people from scrolling down below that point. Any ideas? Something that automatically scrolls them back when they try and scroll down..? Thanks
For further details: What I have is one page with 3 "slides". The first is 768px tall, when they click "enter your email to sign up" it takes them to slide 2. This is the slide I want to be only 373px tall and prevent scrolling. I've tried $('#container').scrollTo( '768px', 500 ).css("height", "373px");
... this sets the height, but you're still able to scroll down and it just shows a big white box.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果页面足够小,他们就没有滚动条可供使用。另一件事是,如果他们阅读有困难,他们可能想要放大并滚动您的表单。如果你仍然决定这样做,你可以设置jquery的$(window).scroll来改变scrolltop。
这是代码:
您可能也可以使用scrollto,但我从未使用过它,所以我不想弄乱它。
If the page is small enough, they won't have scrollbars to use. The other thing is if they have trouble reading they may want to zoom in and scroll around your form. If you are still determined to do this you can set jquery's $(window).scroll to change scrolltop.
This is the code:
You could probably use scrollto too, but I've never used it, so I don't want mess with it.
我最终使用以下命令将页面设置为 768x1024 并禁用所有滚动(这正是我真正想要的):
I ended up make my page 768x1024 and disabling all scrolling (which is what I really wanted anyway) using this: