156 Part III .Document Objects Reference Related Items: (Web design portfolio)
156 Part III .Document Objects Reference Related Items: addEventListener(), detachEvent(), dispatchEvent(), fireEvent(), removeEventListener() methods; Event binding (Chapter 14). blur() focus() Returns: Nothing. NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility The blur() method removes focus from an element, while the focus()method gives focus to an element. Even though the blur() and focus()methods have been around since the earliest scriptable browsers, not every focusable object has enjoyed these methods since the beginning. Browsers prior to IE4 and NN6 limited these methods primarily to the windowobject and form control elements. Windows For window objects, the blur()method (NN3+, IE4+) pushes the referenced window to the back of all other open windows. If other browser suite windows (such as e-mail or news reader windows) are open, the window receiving the blur() method is placed behind these windows as well. The window.blur() method does not adjust the stacking order of the current window in NN6. But a script in a window can invoke the focus() method of another window to bring that other window to the front (provided a scriptable linkage, such as the window.openerproperty, exists between the two windows). The minute you create another window for a user in your Web site environment, you must pay attention to window layer management. With browser windows so easily activated by the slightest mouse click, a user can lose a smaller window behind a larger one in a snap. Most inexperienced users don t think to check the Windows taskbar or browser menu bar (if the browser is so equipped) to see if a smaller window is still open and then activate it. If that subwindow is important to your site design, then you should present a button or other device in each window that enables users to safely switch among windows. The window.focus()method brings the referenced window to the front of all the windows. Rather than supply a separate button on your page to bring a hidden window forward, you should build your window-opening functions in such a way that if the window is already open, the function automatically brings that window forward (as shown in Listing 15-23). This removes the burden of window management from your visitors. The key to success with this method is making sure that your references to the desired windows are correct. Therefore, be prepared to use the window.opener property to refer to the main window if a subwindow needs to bring the main window back into focus. Caution elementObject.blur()
If you are in need for cheap and reliable webhost to host your website, we recommend http web server services.