当前位置: 首页 > 网络学院 > 客户端脚本教程 > HTML DOM > HTML DOM scrolling属性
The scrolling property sets or returns whether or not a frame should have scrollbars.
scrolling属性可设置或是返回框架是否带有滚动条
frameObject.scrolling=yes|no |
In our example we will first create an HTML document containing a frameset with two columns. Each column is set to 50% of the browser window:
在我们的举例中我们将建立一个包含两列的框架集的HTML文档,每个列的宽度设置为浏览器窗口总宽度的50%:
<html> <frameset cols="50%,50%"> <frame id="leftFrame" src="frame_scroll.htm"> <frame id="rightFrame" src="frame_a.htm"> </frameset> </html> |
The HTML document "frame_scroll.htm" is put into the first column, and the HTML document "frame_a.htm" is put into the second column.
"frame_scroll.htm"放置在第一个列,而"frame_a.htm"放在第二个列中。
The source of "frame_scroll.htm" is as follows:
"frame_scroll.htm"代码如下:
<html> <head> <script type="text/javascript"> function enableScrolling() { parent.document.getElementById("leftFrame").scrolling="yes" parent.document.getElementById("rightFrame").scrolling="yes" } function disableScrolling() { parent.document.getElementById("leftFrame").scrolling="no" parent.document.getElementById("rightFrame").scrolling="no" } </script> </head> <body> <input type="button" onclick="enableScrolling()" value="Scroll bars" /> <input type="button" onclick="disableScrolling()" value="No scroll bars" /> </body> </html> |
Frames with and without scrollbars
框架分别带上和不带上滚动条的效果