title: Jquery: Dropdown Menu Delay when mouse over and mouse out
body: <p>I have dropdown menu using jquery function like this:</p>
  
  <pre><code>$(document).ready(function()
  {
      $('li').hover(
      function()
      {
        var timer = $(this).data('timer');
        if(timer) clearTimeout(timer);
        $(this).addClass('over');
      },
  
      function()
      {
        var li = $(this);
        li.data('timer', setTimeout(function(){ li.removeClass('over'); }, 500));
      });
  });
  </code></pre>
  
  <p><strong>Preview: <a href="http://jsbin.com/onawur" rel="nofollow">http://jsbin.com/onawur</a></strong></p>
  
  <p>The function will hide sub menu after 500 ms. I have no idea, how to make  submenu show after 500 ms too. Please help..</p>