HTML DOM cols ÊôÐÔ
¶¨ÒåºÍÓ÷¨
cols ÊôÐÔ¿ÉÉèÖûò·µ»Ø¿ò¼Ü¼¯ÖÐÁеÄÊýÄ¿ºÍ³ß´ç¡£
ÓɶººÅ·Ö¸îµÄÏñËØ»ò°Ù·Ö±ÈÁÐ±í¶¨ÒåÁËÁеÄÊýÄ¿ºÍ¿í¶È£º
Óï·¨
framesetObject.cols=col1,col2,col3....
ʵÀý
ÔÚÎÒÃǵÄÀý×ÓÖУ¬Ê×ÏȽ«´´½¨°üº¬´øÓÐÁ½¸öÁеĿò¼Ü¼¯µÄ HTML Îĵµ¡£Ã¿ÁÐÉèÖÃΪä¯ÀÀÆ÷´°¿ÚµÄ 50%£º
<html> <frameset cols="50%,50%"> <frame src="frame_cols.htm"> <frame src="frame_a.htm"> </frameset> </html>
HTML Îĵµ "frame_cols.htm" ±»·ÅÈëµÚÒ»ÁУ¬¶ø HTML Îĵµ "frame_a.htm" ±»·ÅÈëµÚ¶þÁС£
ÏÂÃæÊÇ "frame_cols.htm" µÄÔ´´úÂ룺
<html>
<head>
<script type="text/javascript">
function changeCols()
{
parent.document.getElementById("main").cols="30%,70%"
}
function restoreCols()
{
parent.document.getElementById("main").cols="50%,50%"
}
</script>
</head>
<body>
<input type="button" onclick="changeCols()"
value="Change column size" />
<input type="button" onclick="restoreCols()"
value="Restore column size" />
</body>
</html>