当前位置: 首页 > 网络学院 > 客户端脚本教程 > HTML DOM > HTML DOM scrolling属性

HTML DOM
DOM TableRow 对象
DOM Textarea 对象
DOM Window 对象

HTML DOM scrolling属性


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 450 ::
收藏到网摘: n/a

The scrolling property sets or returns whether or not a frame should have scrollbars.
scrolling属性可设置或是返回框架是否带有滚动条

Syntax
语法

frameObject.scrolling=yes|no


Example
举例

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>


Try-It-Yourself Demos
尝试与演示

Frames with and without scrollbars
框架分别带上和不带上滚动条的效果

评论 (0) All

登陆 | 还没注册?