<嵌入>PDF 在移动设备上不可滚动嵌入>
我引入了一个
操作系统是IOS。
(注意:我使用嵌入和对象的原因是因为我希望 PDF 显示在网页上,而用户不必单击链接并重定向。)
下面是我使用的代码。
!DOCTYPE html
<html>
<header>
<meta name="viewport" content="width=device-width, initial-scale=1">
</header>
<head>
<style type="text/css">
html {
overflow: auto;
-webkit-overflow-scrolling: touch;
}
body {
height: 100%;
overflow: auto;
-webkit-overflow-scrolling: touch;
margin: 0;
padding: 8px;
}
</style>
</head>
<body>
<object data="https://assets.site-static.com/userFiles/3377/file/Seller_Guide_Final_Use_3822.pdf" type="pdf">
<embed src="https://assets.site-static.com/userFiles/3377/file/Seller_Guide_Final_Use_3822.pdf" width="350" height="500" />
</object>
<script>
$("#iframe").contents().find("body").css({
"height": "100%",
"overflow": "auto",
"-webkit-overflow-scrolling": "touch"
});
</script>
</body>
</html>
I've introduced an <embed> element on my web page for a PDF, it was kind of a weird work around with the web software I'm using but it works fine on a PC. But when I go on mobile it won't scroll at all, it almost looks like the front page of the PDF is just a stationary image on the webpage.
The OS is IOS.
(note: the reason I'm using embed and object is because I want the PDF to display on the webpage without a user having to click a link and be redirected.)
Below is the code I used.
!DOCTYPE html
<html>
<header>
<meta name="viewport" content="width=device-width, initial-scale=1">
</header>
<head>
<style type="text/css">
html {
overflow: auto;
-webkit-overflow-scrolling: touch;
}
body {
height: 100%;
overflow: auto;
-webkit-overflow-scrolling: touch;
margin: 0;
padding: 8px;
}
</style>
</head>
<body>
<object data="https://assets.site-static.com/userFiles/3377/file/Seller_Guide_Final_Use_3822.pdf" type="pdf">
<embed src="https://assets.site-static.com/userFiles/3377/file/Seller_Guide_Final_Use_3822.pdf" width="350" height="500" />
</object>
<script>
$("#iframe").contents().find("body").css({
"height": "100%",
"overflow": "auto",
"-webkit-overflow-scrolling": "touch"
});
</script>
</body>
</html>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论