getClientRects ¸Þ¼µå¿¡ ÀÇÇÏ¿© ¹ÝȯµÈ TextRectangle °³Ã¼µéÀÇ Ä÷º¼ÇÀÌ´Ù.
ÅØ½ºÆ®¸¦ °¡ÁöÁö ¾Ê´Â °³Ã¼µé¿¡¼´Â ºó Ä÷º¼±À» ¹ÝȯÇÑ´Ù.
ÀÌ ÅØ½ºÆ®°¡ Æ÷ÇԵǾî ÀÖ´Â À©µµ¿ìÀÇ Å©±â°¡ Á¶ÀýµÇ´õ¶óµµ TextRectangle °³Ã¼µéÀº ¾÷µ¥ÀÌÆ®µÇÁö ¾Ê´Â´Ù.
ÀÌ °³Ã¼µéÀº ÇÑ ½ËÁ¡¿¡ Æ÷ÂøÇÑ °ÍÀ¸·Î ¾÷µ¥ÀÌÆ®ÇÏ·Á¸é onresize À̺¥Æ®°¡ ¹ß»ýµÇ¸é ¾÷µ¥ÀÌÆ®ÇØ¾ß ÇÑ´Ù.
¼³¸íÀ» À§ÇÑ ¿¹Á¦
getClientRects ¸Þ¼µå·Î ¼Ó¼º º¸´Â ¿¹Á¦
<SCRIPT>
function showRects(obj){
cRects=obj.getClientRects();
colLn=cRects.length
str='';
for (i=0;i< colLn;i++){
str+=(i+1)+'¹ø TextRectangle<UL>';
str+='<LI>cRects('+i+').top='+cRects(i).top+' pixel.';
str+='<LI>cRects('+i+').bottom='+cRects(i).bottom+' pixel.';
str+='<LI>³ôÀÌ (cRects('+i+').bottom-cRects('+i+').top)='+(cRects(i).bottom-cRects(i).top)+' pixel.';
str+='<LI>cRects('+i+').right='+cRects(i).right+' pixel.';
str+='<LI>cRects('+i+').left='+cRects(i).left+' pixel.';
str+='<LI>³Êºñ (cRects('+i+').right-cRects('+i+').left)='+(cRects(i).right-cRects(i).left)+' pixel.</UL>';
}
showA.innerHTML=str;
}
</SCRIPT>
<BUTTON onclick=showRects(document.body.createTextRange()))>TextRectangles º¸±â Ŭ¸¯</BUTTON>
<DIV id=showA style=width:400;height:9em>°á°ú Ç¥½Ãâ</DIV>