HTML DOM rows ตัวแปร
การระบุและการใช้งาน
rows ตัวแปรสามารถตั้งค่าหรือกลับค่าจำนวนและขนาดของบรรทัดใน frame:
รายการพิกัดเซนติเมตรหรือเปอร์เซ็นต์ที่แยกด้วยคอมมาห์กำหนดจำนวนและความสูงของคอลัมน์:
รูปแบบ
framesetObject.rows=row1,row2,row3....
ตัวอย่าง
ในตัวอย่างของเรา ในตอนแรกจะสร้างเอกสาร HTML ที่มี frameset ที่มีสองคอลัมน์:
<html> <frameset rows="50%,50%"> <frame src="frame_rows.htm"> <frame src="frame_a.htm"> </frameset> </html>
เอกสาร HTML "frame_rows.htm" ถูกจัดให้อยู่ในคอลัมน์แรก และเอกสาร HTML "frame_a.htm" ถูกจัดให้อยู่ในคอลัมน์ที่สอง
ในนี้คือรหัสต้นฐานของ "frame_rows.htm"
<html> <head> <script type="text/javascript"> function changeRows() {parent.document.getElementById("main").rows="30%,70%"
} function restoreRows() {parent.document.getElementById("main").rows="50%,50%"
} </script> </head> <body> <form> <input type="button" onclick="changeRows()" value="Change row size" /> <input type="button" onclick="restoreRows()" value="Restore row size" /> </form> </body> </html>