Mouse Capture Menu Sample #2

This sample uses the mouse capture functionality of Microsoft® Internet Explorer 5 and later. The menu groups and menu items have been added dynamically. Adding the groups and items through script provides an easy and extensible way to use the same menu code for multiple pages and Web-based applications without having to rewrite the HTML.

While the drop-down menu is open and "Search Engines" is visible, try to click on the anchor "Test". You will notice that the anchor does not fire and the menu closes. When the menu closes, the anchor will function. This happens because the menu is capturing mouse events, so onclick events go to the fnSwitchMenu function. The function will prevent the click from continuing, but will close the menu and release mouse capture.

Test Mouse Capture



© 1999 Microsoft Corporation. All rights reserved. Terms of use.