Adding a delay/timeout to dropdown menu
Hi everyone, I'm new to this forum!
The code below is working fine for me, however I would like to add a delay / timeout to it..
Everytime I move my mouse off the element it jumps away really fast..
- <script type="text/javascript">
- // Executes the function when DOM will be loaded fully
- $(document).ready(function () {
- // hover property will help us set the events for mouse enter and mouse leave
- $('.menu li').hover(
- // When mouse enters the element
- function () {
- //Fade in the navigation submenu
- $('ul', this).fadeIn(); // fadeIn will show the sub cat menu
- },
- // When mouse leaves the element
- function () {
- //Fade out the navigation submenu
- $('ul', this).fadeOut(); // fadeOut will hide the sub cat menu
- }
- );
- });
- </script>