370897-1.html (867B)
1 <html> 2 <head> 3 <script type="text/javascript"> 4 var w_inc = 1; 5 var h_inc = 1; 6 function resizeContainer(id) { 7 var e = document.getElementById(id); 8 var w = e.clientWidth; 9 if (w > 800 && w_inc==1) 10 w_inc=-1; 11 if (w < 100 && w_inc==-1) 12 w_inc=1; 13 e.style.width=(w+w_inc)+'px'; 14 15 var h = e.clientHeight; 16 if (h > 800 && h_inc==1) 17 h_inc=-1; 18 if (h < 100 && h_inc==-1) 19 h_inc=1; 20 e.style.height=(h+h_inc)+'px'; 21 } 22 23 function boom() { 24 var table = document.getElementById('table'); 25 var newNode = document.createElement('caption'); 26 table.appendChild(newNode); 27 resizeContainer('test'); 28 29 newNode = document.createElement('caption'); 30 table.appendChild(newNode); 31 } 32 33 </script> 34 <title></title> 35 </head> 36 37 38 <body onload="boom()"> 39 40 <div id="test"> 41 <table id="table" width="100%" height="100%"><tbody><tr><td></td></tr></tbody></table> 42 </div> 43 44 </body> 45 </html>