Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/373.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Iframe滚动问题_Javascript_Jquery_Html_Css_Iframe - Fatal编程技术网

Javascript 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来拉入在不同域上开发的小部件

<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="" />