| Menu remains highlighted after alert ¶ | |
| Browser: IE 6.0.2800.1106 We have implemented a Help->About menu that uses a simple javascript alert to pop up an "About Us" window. After clicking "OK", the "Help" menu remains highlighted; if you click on the Help menu it no longer responds until you click somewhere else. I have created a test case for you (below); you may need to tweak it as appropriate. Simply open this up in IE, click Help menu and then select "About Us" menu item and observe. I tried to route my javascript through a separate function and use retval but that didn't work. Then I thought maybe I can obtain a reference to the "Help" menu and call setPressed(false) but that didn't work either. Please help! <HTML> <style type="text/css">@import url("./hmenu/skin-xp-extended.css");</style> <script type="text/javascript"> function initializeMenus() </script> </HEAD> <ul id="menu" style="display: none;"> <li id="File" title="_File"> <li id="Help" title="_Help"> </BODY> | |
| Re: Menu remains highlighted after alert ¶ | |
| There is a problem indeed with your approach. The menu closes right after evaluating the JavaScript expression, but an “alert” dialog is modal (it stops the JS threads until the end user clicked on OK). We hope to be able to make this easier in next versions, but for now here is a quick workaround: <script type="text/javascript"> So as you can see, the idea is to delay the displaying of the alert by a short time (10 milliseconds). During that time, the browser will get a chance to run the code that closes the menu. I hope this helps. | |
| last |
| Re[2]: Menu remains highlighted after alert ¶ | |
| You guys game through again. That worked. Thanks! | |
| last |














