tailieunhanh - JavaScript Bible, Gold Edition part 195

JavaScript Bible, Gold Edition part 195. This book will bring programmers and non-technical professionals, including casual programmers and scripters, painlessly up to speed on all aspects of mastering JavaScript. Key topics include programming fundamentals, JavaScript language elements and how to use them effectively, and how to easily and efficiently add powerful new functionality to HTML documents and Java applets. | CD-432 Part VI Appendixes TextRange Object Properties boundingHeight boundingLeft boundingTop boundingWidth NN2 NN3 NN4 NN6 IE3 J1 IE3 J2 IE4 IE5 Compatibility Example Listing 19-9 provides a simple playground to explore the four bounding properties and two offset properties of a TextRange object. As you select text in the big paragraph the values of all six properties are displayed in the table. Values are also updated if you resize the window via an onResize event handler. Notice for example if you simply click in the paragraph without dragging a selection the boundingWidth property shows up as zero. This action is the equivalent of a TextRange acting as an insertion point. Listing 19-9 Exploring the Bounding TextRange Properties HTML HEAD TITLE TextRange Object Dimension Properties TITLE STYLE TYPE text css TD text-align center .propName font-family Courier monospace STYLE SCRIPT LANGUAGE JavaScript function setAndShowRangeData var range Appendix F Examples from Parts III and IV CD-433 SCRIPT HEAD BODY onResize setAndShowRangeData H1 TextRange Object Dimension Properties H1 HR P Select text in the paragraph below and observe the bounding property values for the TextRange object created for that selection. P TABLE ID results BORDER 1 CELLSPACING 2 CELLPADDING 2 TR TH Property TH TH Pixel Value TH TR TR TD CLASS propName boundingHeight TD TD CLASS count ID B1 nbsp TD TR TR TD CLASS propName boundingWidth TD TD CLASS count ID B2 nbsp TD TR TR TD CLASS propName boundingTop TD TD CLASS count ID B3 nbsp TD TR TR TD CLASS propName boundingLeft TD TD CLASS count ID B4 nbsp TD TR TR TD CLASS propName offsetTop TD TD CLASS count ID B5 nbsp TD TR TR TD CLASS propName offsetLeft TD TD CLASS count ID B6 nbsp TD TR TABLE HR P .

TỪ KHÓA LIÊN QUAN