我是靠谱客的博主 苹果机器猫,这篇文章主要介绍JS去除iframe滚动条的方法,现在分享给大家,希望可以做个参考。

本文实例讲述了JS去除iframe滚动条的方法。分享给大家供大家参考。具体如下:

下面的代码可以通过修改scrolling来去除iframe的滚动条

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<!DOCTYPE html> <html> <head> <script> function removeScroll() { document.getElementById("myframe").scrolling="no"; } </script> </head> <body> <iframe id="myframe" src="/default.asp" scrolling="auto"> <p>Your browser does not support iframes.</p> </iframe> <p>The value of the scrolling attribute is: <script> document.write(document.getElementById("myframe").scrolling); </script> <p> <input type="button" onclick="removeScroll()" value="Remove Scrollbars"> <p>Internet Explorer, Google Chrome, Opera, and Safari have problems with setting the scrolling attribute.</p> </body> </html>

希望本文所述对大家的javascript程序设计有所帮助。

最后

以上就是苹果机器猫最近收集整理的关于JS去除iframe滚动条的方法的全部内容,更多相关JS去除iframe滚动条内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(185)

评论列表共有 0 条评论

立即
投稿
返回
顶部