当前位置: 首页 > 网络学院 > 客户端脚本教程 > HTML DOM > HTML DOM noResize属性
The noResize property sets or returns whether or not a frame can be resized.noResize
noResize属性可以设置或返回框架是否可以重置大小
frameObject.noResize=true|false |
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_noresize.htm"> <frame id="rightFrame" src="frame_a.htm"> </frameset> </html> |
The HTML document "frame_noresize.htm" is put into the first column, and the HTML document "frame_a.htm" is put into the second column.
"frame_noresize.htm"为放在第一个列的HTML文档,"frame_a.htm"则为放在第二列的文档
The source of "frame_noresize.htm" is as follows:
"frame_noresize.htm"的代码如下:
<html> <head> <script type="text/javascript"> function disableResize() { parent.document.getElementById("leftFrame").noResize=true parent.document.getElementById("rightFrame").noResize=true } function enableResize() { parent.document.getElementById("leftFrame").noResize=false parent.document.getElementById("rightFrame").noResize=false } </script> </head> <body> <input type="button" onclick="disableResize()" value="No resize" /> <input type="button" onclick="enableResize()" value="Resize" /> </body> </html> |
Resizable and not resizable frames
调整框架是否可以重置大小