JS去除iframe滚动条的方法
本文实例讲述了JS去除iframe滚动条的方法。分享给大家供大家参考。具体如下:
下面的代码可以通过修改scrolling来去除iframe的滚动条
<!DOCTYPEhtml> <html> <head> <script> functionremoveScroll() { document.getElementById("myframe").scrolling="no"; } </script> </head> <body> <iframeid="myframe"src="/default.asp"scrolling="auto"> <p>Yourbrowserdoesnotsupportiframes.</p> </iframe> <p>Thevalueofthescrollingattributeis: <script> document.write(document.getElementById("myframe").scrolling); </script> <p> <inputtype="button"onclick="removeScroll()" value="RemoveScrollbars"> <p>InternetExplorer,GoogleChrome,Opera, andSafarihaveproblemswithsetting thescrollingattribute.</p> </body> </html>
希望本文所述对大家的javascript程序设计有所帮助。