We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ejmenu on mouseout hide the menu after some time

Thread ID:

Created:

Updated:

Platform:

Replies:

127477 Nov 17,2016 04:01 PM UTC Nov 22,2016 05:06 AM UTC JavaScript 5
loading
Tags: ejMenu
Balasubramanian Ramanathan
Asked On November 17, 2016 04:01 PM UTC

Hi,

When the mouseout event happens on ejmenu the menu hides immediately. It is possible to apply some delay in hiding the menu like hide after 5 or 10 seconds.

We want the menu to be displayed for some seconds even after doing mouseout of the menu.

Thanks

Prince Oliver [Syncfusion]
Replied On November 18, 2016 12:08 PM UTC

Hi Balasubramanian,   
   
Thanks for contacting Syncfusion Support.   
   
Query1: When the mouseout event happens on ejmenu the menu hides immediately. It is possible to apply some delay in hiding the menu like hide after 5 or 10 seconds.   
   
Yes, it is possible to delay before hiding the menu items. To delay, you need to override the menu’s _hideAnimation function to delay before the menu element slides up. Have a look at the following code snippet.   
   
ej.Menu.prototype._hideAnimation =  function (element, anim) {   
            switch (anim) {   
                case "slideUp":   
                    $(element).attr({ "aria-hidden"true });   
                    element.delay(5000).slideUp(this.model.enableAnimation ? 100 : 0);break;   
                case "none":   
                    element.css("display""none"); break;   
            }   
            element.closest('li').removeClass('e-active e-mfocused');   
        };   
  
   
Note: The duration for delay is given in milliseconds.   
   
Refer to the Playground Sample 
   
Regards,   
Prince 


Balasubramanian Ramanathan
Replied On November 18, 2016 12:21 PM UTC

Thank you for the reply.

Applying the delay makes the menu to stay for sometime after the timeout. But it has an issue. When we mouse out of one menu to other the previous menu has to disappear immediately. The mouse out delay has to happen only when we move out of  menu control

Please check the attached screenshot.

can we fix this too?

Thanks

Attachment: MenuOverlap_65988b78.zip

Prince Oliver [Syncfusion]
Replied On November 21, 2016 12:24 PM UTC

Hi Balasubramanian, 

Thanks for your reply. 

Query: Applying the delay makes the menu to stay for sometime after the timeout. But it has an issue. When we mouse out of one menu to other the previous menu has to disappear immediately. The mouse out delay has to happen only when we move out of  menu control. can we fix this too? 

Yes, this is also possible. You need to override the menu’s _showAnimation function to hide all the other li elements that are previously show and stop their animation before displaying the next element. Have a look at the following code snippet. 

ej.Menu.prototype._showAnimation = function (element, anim) { 
            switch (anim) { 
                case "slideDown": 
                    element.closest("li").siblings("li").children("ul").css("display", "none"); 
                    element.stop(true, true).slideDown(this.model.enableAnimation ? 200 : 0); break; 
                case "none": 
                    element.css("display", "block"); break; 
            } 
        }; 

Refer to the Playground Sample 

Regards, 
Prince

Balasubramanian Ramanathan
Replied On November 21, 2016 12:35 PM UTC

Thanks you. It works fine now.



Prince Oliver [Syncfusion]
Replied On November 22, 2016 05:06 AM UTC

  
Hi Balasubramanian,   
  
Most welcome.     
     
We are glad to hear that issue has been fixed.      
Please let us know if you need further assistance on.  
     
Regards,      
Prince 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;