js设置iframe滚动条的位置
<html> <head> <span><span class="tag"><</span><span class="tag-name">script</span><span> </span><span class="attribute">src</span><span>=</span><span class="attribute-value">"http://libs.baidu.com/jquery/2.0.0/jquery.min.js"</span><span class="tag">></span><span class="tag"></</span><span class="tag-name">script</span><span class="tag">></span><span> </span></span> <script type="text/javascript"> $(document).ready(function(){ $("button").click(function(){ $(window.frames["iframe1"].document).scrollTop("10"); }); }); </script> </head> <body> <iframe src="http://www.w3school.com.cn/example/html/demo_iframe.html" height="60px" name="iframe1"> <p>Your browser does not support iframes.</p> </iframe> <button type="button">Click me</button> </body> </html>
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。