Marco Hsu Posted November 4, 2016 Share Posted November 4, 2016 I want to let the UniMainMenu control mouse close to the automatic pop-up sub menu, how to set up? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 4, 2016 Share Posted November 4, 2016 Hi, For now can you try this solution ?!: 1. type TUniExMainMenu = class(TuniMainMenu) end; 2. procedure TMainForm.UniFormReady(Sender: TObject); var MainMenuJSName: string; begin MainMenuJSName := TUniExMainMenu(UniMainMenu1).GetMenuControl.JSName; UniSession.AddJS(MainMenuJSName + '.items.items.forEach(function(m){m.addListener("mouseover", function(){this.showMenu()})})'); end; Best regards. Quote Link to comment Share on other sites More sharing options...
Marco Hsu Posted November 4, 2016 Author Share Posted November 4, 2016 Thank you ! Quote Link to comment Share on other sites More sharing options...
Frederick Posted October 6, 2023 Share Posted October 6, 2023 I use the above JS code to auto drop down the sub-menu when the mouse cursor is over the TUniMainMenu. How do I auto close the sub-menu when the mouse cursor is not over the TUniMainMenu? -- Frederick (UniGUI Complete - Professional Edition 1.90.0.1573) Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 6, 2023 Share Posted October 6, 2023 Hello, I will check. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 6, 2023 Share Posted October 6, 2023 2 hours ago, Frederick said: I use the above JS code to auto drop down the sub-menu when the mouse cursor is over the TUniMainMenu. How do I auto close the sub-menu when the mouse cursor is not over the TUniMainMenu? Do you have a two-level menu? Quote Link to comment Share on other sites More sharing options...
Frederick Posted October 6, 2023 Share Posted October 6, 2023 Yes. It may possible to have up to 3 levels. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 6, 2023 Share Posted October 6, 2023 36 minutes ago, Frederick said: It may possible to have up to 3 levels. Then, if I understand you correctly, this is logically impossible I think. Quote Link to comment Share on other sites More sharing options...
Frederick Posted October 6, 2023 Share Posted October 6, 2023 Ok, thanks anyway Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.