简体   繁体   English

iPad - 无法在框架内滚动

[英]iPad - cannot scroll inside frame

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: 我已经尝试了两件事:

  1. 2-finger scroll 双指滚动
  2. Using object/embed instead of frame 使用object / embed而不是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. 先感谢您。

According to this article http://support.apple.com/kb/ht1484 you cannot scroll anything inside a frame when using Safari on the iPad. 根据这篇文章http://support.apple.com/kb/ht1484 ,在iPad上使用Safari时,无法在框架内滚动任何内容。 The frames always get resized to fit their content (this also applies to iframes). 帧总是会调整大小以适应其内容(这也适用于iframe)。 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. 为此,Safari甚至会忽略您在frameset-tag中创建的“cols”或“rows”的值,并且似乎使用所需的任何值。 Unfortunately, the frame does not resize properly for PDFs so they get cut off. 不幸的是,框架没有为PDF正确调整大小,因此它们被切断了。

I think your best choice might be to link the pdf directly... 我认为你最好的选择可能是直接链接pdf ...

I think the problem is that you are trying to display a PDF. 我认为问题在于您正在尝试显示PDF。 The 2-finger swipe approach should work for regular HTML frames. 双指滑动方法应适用于常规HTML框架。

One option is to use Google Docs Viewer (http://docs.google.com/viewer) in your application. 一种选择是在您的应用程序中使用Google文档查看器(http://docs.google.com/viewer)。

You could hide empty divs at certain positions in the frame, and use jQuery to scroll to those positions. 您可以在框架中的某些位置隐藏空div,并使用jQuery滚动到这些位置。 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. 因此用户将无法滚动框架,但他们可以单击导航,将框架移动到pproper部分。

Have you tried the Ext JS 4 JavaScript Framework? 你有没有尝试过Ext JS 4 JavaScript Framework? On their forum they speak of the possibility to show a PDF in a panel . 在他们的论坛上,他们谈到了在面板中显示PDF可能性 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. 该解决方案并非特定于iPad,但我听说一般来说Ext JS在iPad上运行良好。 Anyone else have experience with this framework? 其他人都有这个框架的经验吗?

I have noticed when browsing StackOverflow on an IPad that any code in a frame that scrolls outside visible is not accessible. 我注意到在IPad上浏览StackOverflow时,无法访问可在外部滚动的框架中的任何代码。 I think it may simply be a limitation of Safari on the IPad / IPhone 我认为这可能只是Safari对IPad / IPhone的限制

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

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