Page is a not externally linkable
Fotiman - 3:01 pm on Aug 10, 2012 (gmt 0)
setTimeout will run in a different scope, where "this" is not the same as "this" within the mousover callback function. You just need to create a closure to get around it. You can do that by changing your callback like so:
$(document).ready(function () {
var navTimeout;
$('.mainNav-expand').mouseover(function() {
var that = this;
navTimeout = setTimeout(function() {
$('.mainNavContent').hide();
$(that).children('.mainNavContent').show();
alert("menu test");
}, 500);
}).mouseleave(function() {
clearTimeout(myTimeout);
});
$("#mainNav-bar").mouseout(function() {
$('.mainNavContent').hide();
});
$(".mainNav-close").click(function() {
$('.mainNavContent').hide();
});
});
[jsfiddle.net...]