tailieunhanh - JavaScript Bible, Gold Edition part 32
JavaScript Bible, Gold Edition part 32. 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. | 158 Part III Document Objects Reference An unfortunate side effect of button focus in Win32 environments is that the focus highlight a dotted rectangle remains around the button after a user clicks it and until another object gets focus. You can eliminate this artifact for browsers and objects that implement the onMouseUp event handler by including the following event handler in your buttons onMouseUp recognizes the often undesirable effect of that dotted rectangle and lets scripts set the hideFocus property of an element to true to keep that rectangle hidden while still giving the element focus. It is a tradeoff for the user however because there is no visual feedback about which element has focus. Other elements For other kinds of elements that support the focus method you can bring an element into view in lieu of the scrollIntoView method. Link A and AREA elements in Windows versions of IE display the dotted rectangle around them after a user brings focus to them. To eliminate that artifact use the same onMouseUp event handler as or hideFocus property just described for form controls. Microsoft increased the breadth of objects that support the blur and focus methods in IE5. On the Example with Listing 15-23 on the CD-ROM Related Items document. formObject. textObject .select methods. clearAttributes Returns Nothing. NN2 NN3 NN4 NN6 IE3 J1 IE3 J2 IE4 IE5 Compatibility The clearAttributes method removes all attributes from an element except the NAME and ID values. Thus styles and event handlers are removed as are custom attributes assigned in either the HTML source code or later by script. You should know that the clearAttributes method does not alter the length of the element s attributes collection because the collection always contains all possible attributes for an element. See the attributes property for elements earlier in this chapter. This method is handy if you wish to construct an entirely new set of .
đang nạp các trang xem trước