Đang chuẩn bị liên kết để tải về tài liệu:
JavaScript Bible, Gold Edition part 178

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

JavaScript Bible, Gold Edition part 178. 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-262 Part VI Appendixes Listing 16-8 continued SCRIPT LANGUAGE JavaScript function gatherWindowData var msg msg B From the point of view of this frame B BR msg window.frames.length window.frames.length BR msg window.name window.name P msg B From the point of view of the framesetting document B BR msg parent.frames.length parent.frames.length BR msg parent.frames 0 .name parent.frames 0 .name return msg SCRIPT HEAD BODY SCRIPT LANGUAGE JavaScript document.write gatherWindowData SCRIPT BODY HTML Figure 16-5 Property readouts from both frames loaded from Listing 16-7 windowObject.frames Appendix F Examples from Parts III and IV CD-263 The last statement in the example shows how to use the array syntax brackets to refer to a specific frame. All array indexes start with 0 for the first entry. Because the document asks for the name of the first frame parent.frames 0 the response is JustAKidl for both frames. innerHeight innerWidth outerHeight outerWidth NN2 NN3 NN4 NN6 IE3 J1 IE3 J2 IE4 IE5 IE5.5 Compatibility Example In Listing 16-9 a number of buttons let you see the results of setting the innerHeight innerWidth outerHeight and outerWidth properties. Listing 16-9 Setting Window Height and Width HTML HEAD TITLE Window Sizer TITLE SCRIPT LANGUAGE JavaScript store original outer dimensions as page loads var originalWidth window.outerWidth var originalHeight window.outerHeight generic function to set inner dimensions function setInner width height window.innerWidth width window.innerHeight height generic function to set outer dimensions function setOuter width height window.outerWidth width window.outerHeight height Continued windowObject.innerHeight CD-264 Part VI Appendixes Listing 16-9 continued restore window to original dimensions function restored window.outerWidth originalWidth window.outerHeight originalHeight SCRIPT HEAD BODY FORM B Setting Inner Sizes B BR INPUT TYPE button VALUE 600 Pixels Square onClick setInner 600 600 BR INPUT TYPE button VALUE 300 Pixels .