I have items contained in an unordered list. I have hidden divs (using display:none;) outside of this list. When you hover over a list item, I would like the div to appear
Something like this should work.
Using .hover to bind the event, .index and .eq to find which one to show/hide and the native JS methods for timeouts to let you hover the divs.
var timeout; // store a timeout here
$('#main-menu lia ').hover(function ()
{
$('.widget-container').eq($(this).parent().index()).show();
}, function ()
{
timeout = setTimeout(function ()
{
$('.widget-container').eq($(this).parent().index()).hide();
}, 1000);
);
$('.widget-container').hover(function ()
{
clearTimeout(timeout);
}, function ()
{
timeout = setTimeout(function ()
{
$(this).hide();
}, 1000);
});