您现在的位置: 365建站网 > 建站教程 > JavaScript 教程 > HTML DOM rows 属性

HTML DOM rows 属性

此节有 162 人学习过     参与评论

定义和用法

rows 属性可设置或返回框架中行的数目和尺寸。

由逗号分割的像素或百分比列表定义了列的数目和高度:

语法

</>code

  1. framesetObject.rows=row1,row2,row3....

实例

在我们的例子中,首先将创建包含带有两个列的框架集的 HTML 文档。每列设置为浏览器窗口的 50%:

</>code

  1. <html>
  2. <frameset rows="50%,50%">
  3. <frame src="frame_rows.htm">
  4. <frame src="frame_a.htm">
  5. </frameset>
  6. </html>

HTML 文档 "frame_rows.htm" 被放入第一列,而 HTML 文档 "frame_a.htm" 被放入第二列。

下面是 "frame_rows.htm" 的源代码:

</>code

  1. <html>
  2. <head>
  3. <script type="text/javascript">
  4. function changeRows()
  5. {
  6. parent.document.getElementById("main").rows="30%,70%"
  7. }
  8. function restoreRows()
  9. {
  10. parent.document.getElementById("main").rows="50%,50%"
  11. }
  12. </script>
  13. </head>
  14. <body>
  15. <form>
  16. <input type="button" onclick="changeRows()"
  17. value="Change row size" />
  18. <input type="button" onclick="restoreRows()"
  19. value="Restore row size" />
  20. </form>
  21. </body>
  22. </html>

亲自试一试

更改框架集的行尺寸

如对本文有疑问,请提交到交流论坛,广大热心网友会为你解答!! 点击进入论坛

发表评论 (162人查看0条评论)
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
昵称:
最新评论
------分隔线----------------------------
JavaScript 教程目录

快速入口

· 365软件
· 杰创官网
· 建站工具
· 网站大全

其它栏目

· 建站教程
· 365学习

业务咨询

· 技术支持
· 服务时间:9:00-18:00
365建站网二维码

Powered by 365建站网 RSS地图 HTML地图

copyright © 2013-2024 版权所有 鄂ICP备17013400号