Is there an easy way to add events (eg. via javascript/stylesheet) to add delays on a top navigation menu when exiting on-hover menu items, so they are not immediately gone when the mouse cursor is no longer hovering on the menu(item)
On-leave event (delay) for top nav menu items?
On-leave event (delay) for top nav menu items?
Hi all,
Is there an easy way to add events (eg. via javascript/stylesheet) to add delays on a top navigation menu when exiting on-hover menu items, so they are not immediately gone when the mouse cursor is no longer hovering on the menu(item)
Is there an easy way to add events (eg. via javascript/stylesheet) to add delays on a top navigation menu when exiting on-hover menu items, so they are not immediately gone when the mouse cursor is no longer hovering on the menu(item)
-
Jbleasdale
- Propeller Head
- Posts: 58
- Joined: Tue Mar 21, 2017 3:35 pm
Re: On-leave event (delay) for top nav menu items?
I think anything you build will conflict with Madcaps own script as that controls the hover events for the Top Nav menu items. However, could be worth giving it a go in Javascript or Jquery.
I was prototyping something recently that did something similar but it was a custom item I was controlling based on the Top Nav hover, so it did not conflict with anything else.
Best of luck.
I was prototyping something recently that did something similar but it was a custom item I was controlling based on the Top Nav hover, so it did not conflict with anything else.
Best of luck.
Re: On-leave event (delay) for top nav menu items?
You could do this with CSS, by setting transition effects on the menus.
Menus are shown/hidden by adjusting the visibility and opacity properties.
For example, this will add a delay to the menu (ul.navigation li > ul), by setting a 1s transition for visibility and opacity:
You'll need to work on this further yourself, but that should be enough to give you the idea.
Menus are shown/hidden by adjusting the visibility and opacity properties.
For example, this will add a delay to the menu (ul.navigation li > ul), by setting a 1s transition for visibility and opacity:
Code: Select all
ul.navigation li > ul
{
transition: opacity 1s, visibility 1s !important
}Re: On-leave event (delay) for top nav menu items?
Thank you both for the info!
