tailieunhanh - JavaScript Bible, Gold Edition part 208

JavaScript Bible, Gold Edition part 208. 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-562 Part VI Appendixes The two functions that report the results employ a bit of filtering to make sure that they process the event object only if the event occurs on an element and if the relatedTarget element is anything other than a nested text node of the central table cell element. Because nodes respond to events in NN6 this extra filtering prevents processing whenever the cursor makes the transition from the central TD element to its nested text node. Listing 29-21 Using the relatedTarget Property HTML HEAD TITLE relatedTarget Properties TITLE STYLE TYPE text CSS .direction background-color 00FFFF width 100 height 50 text-align center main background-color FF6666 text-align center STYLE SCRIPT LANGUAGE JavaScript function showArrival evt if 1 if var direction parts unknown status Arrived from direction function showDeparture evt if 1 if var direction parts unknown status Departed to direction SCRIPT HEAD BODY H1 relatedTarget Properties H1 HR P Roll the mouse to the center box and look for arrival information in the status bar. Roll the mouse away from the center box and look for departure information in the status bar. P TABLE CELLSPACING 0 CELLPADDING 5 TR TD TD TD CLASS direction North TD TD TD TR TR TD CLASS direction West TD TD ID main onMouseOver showArrival event onMouseOut showDeparture event Roll TD NN6 evenfOb Appendix F Examples from Parts III and IV CD-563 TD CLASS direction East TD TR TR TD TD TD CLASS direction South TD TD TD TR TABLE BODY HTML target NN2 NN3 NN4 NN6 IE3 J1 IE3 J2 IE4 IE5 Compatibility Example As a simplified demonstration of the power of the target property Listing 29-22 has but two event handlers defined for the BODY element each invoking a single .

TỪ KHÓA LIÊN QUAN