macos iPad - 无法在框架内滚动
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5791251/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
iPad - cannot scroll inside frame
提问by testndtv
I cannot scroll a pdf called inside a frame in iPad Safari
我无法在 iPad Safari 中滚动框架内调用的 pdf
<frame src="ebook.pdf" title="Content Frame" name="content" id="content"
frameborder="0" border="0" noresize scrolling="yes" marginwidth="0" marginheight="0"
noresizescrolling="AUTO" framespacing="0" />
I have already tried 2 things:
我已经尝试了两件事:
- 2-finger scroll
- Using object/embed instead of frame
- 两指滚动
- 使用对象/嵌入而不是框架
But this does not work.
但这不起作用。
In fact I have tried a lot of things...overflow, height, etc..
事实上,我已经尝试了很多东西……溢出、高度等。
Please help me. Thank you in advance.
请帮我。先感谢您。
回答by Philipp Horn
According to this article http://support.apple.com/kb/ht1484you cannot scroll anything inside a frame when using Safari on the iPad. The frames always get resized to fit their content (this also applies to iframes). To do this, Safari even dismisses the values for "cols" or "rows" you made in the frameset-tag and seems to use whatever value is needed. Unfortunately, the frame does not resize properly for PDFs so they get cut off.
根据这篇文章http://support.apple.com/kb/ht1484,在 iPad 上使用 Safari 时,您无法在框架内滚动任何内容。框架总是会调整大小以适合其内容(这也适用于 iframe)。为此,Safari 甚至取消了您在框架集标签中创建的“cols”或“rows”的值,并且似乎使用了所需的任何值。不幸的是,框架无法为 PDF 正确调整大小,因此它们被截断。
I think your best choice might be to link the pdf directly...
我认为您最好的选择可能是直接链接 pdf...
回答by Artilheiro
I think the problem is that you are trying to display a PDF. The 2-finger swipe approach should work for regular HTML frames.
我认为问题在于您正在尝试显示 PDF。两指滑动方法应该适用于常规 HTML 框架。
One option is to use Google Docs Viewer (http://docs.google.com/viewer) in your application.
一种选择是在您的应用程序中使用 Google Docs Viewer (http://docs.google.com/viewer)。
回答by Steve Kelly
You could hide empty divs at certain positions in the frame, and use jQuery to scroll to those positions. So the user wouldn't be able to scroll the frame, but they could click navigation which would move the frame to the pproper section.
您可以在框架中的某些位置隐藏空的 div,并使用 jQuery 滚动到这些位置。因此,用户将无法滚动框架,但他们可以单击导航,将框架移动到适当的部分。
回答by Mushimo
Have you tried the Ext JS 4JavaScript Framework? On their forum they speak of the possibility to show a PDF in a panel. The forum thread contains example code. The solution is not specific to iPad but I hear that in general Ext JS works very well on iPad. Anyone else have experience with this framework?
您是否尝试过Ext JS 4JavaScript 框架?在他们的论坛上,他们谈到在面板中显示 PDF的可能性。论坛线程包含示例代码。该解决方案并非特定于 iPad,但我听说 Ext JS 通常在 iPad 上运行良好。其他人对这个框架有经验吗?
回答by Toby Allen
I have noticed when browsing StackOverflow on an IPad that any code in a frame that scrolls outside visible is not accessible. I think it may simply be a limitation of Safari on the IPad / IPhone
我注意到在 iPad 上浏览 StackOverflow 时,无法访问框架中滚动到可见范围之外的任何代码。我认为这可能只是 iPad / iPhone 上 Safari 的限制