我正在尝试使用 iframe 显示 pdf 的内容。在普通电脑上一切正常。然而,在苹果的移动设备(IPhone/IPad)上,只有 pdf 的第一页被显示。
这是我的代码,我已经添加了一些滚动样式,因为我认为这是与滚动相关的问题,但是如果我将 iframe 设置得非常小,则可以滚动!然而问题还是一样...只有第一页是可见的。
<div class="scroll-wrapper">
<iframe height="260" width="280" src="info.pdf"> </iframe>
</div>
.scroll-wrapper{
overflow-y:scroll;
-webkit-overflow-scrolling:touch;
width: 400px;
height: 300px;
}
Run Code Online (Sandbox Code Playgroud) 我试图用 JavaScript 更改我的 html 代码的一部分,但我无法让它工作:
function trigger(){
document.getElementById('mycheckbox').innerHTML="<input type="checkbox" id="mycheckbox" checked>";
}
function triggerOff(){
document.getElementById('mycheckbox').innerHTML="<input type="checkbox" id="mycheckbox">";
}Run Code Online (Sandbox Code Playgroud)
<input type="checkbox" id="mycheckbox">
<button type="button" onclick="trigger()">test</button>
<button type="button" onclick="triggerOff()">test</button>Run Code Online (Sandbox Code Playgroud)
因此,如果我按下该按钮,我想将选中状态添加到我的 HTML 中,如果我按下另一个按钮,我想删除选中状态。这可能吗?
非常感谢所有帮助!非常感谢大家!