Javascript Iframe滚动问题
我使用iframe来拉入在不同域上开发的小部件Javascript Iframe滚动问题,javascript,jquery,html,css,iframe,Javascript,Jquery,Html,Css,Iframe,我使用iframe来拉入在不同域上开发的小部件 <iframe allowfullscreen="allowfullscreen" src="https://otherdomain.com" width="100%" data-embed="true" frameborder="0" height="800"></iframe> 以及iframe内容顶部的输入框: <input type="text" id="top" style="" /> 这管用!
<iframe allowfullscreen="allowfullscreen" src="https://otherdomain.com" width="100%" data-embed="true" frameborder="0" height="800"></iframe>
以及iframe内容顶部的输入框:
<input type="text" id="top" style="" />
这管用!它将用户带到iframe内容的顶部。我试图将输入框更改为div,但它不起作用。然后,我试图隐藏输入框,但当你在输入框中聚焦时,它仍然会显示移动“键盘”
如何在不使用输入框的情况下成功跳转到页面顶部
$('#top').focus();
<input type="text" id="top" style="" />