控制台最后没有检测overExpand
为真。难道我做错了什么?
var transLayer = $('.transparentBg');
var overExpand = false;
var overUl = false;
$(transLayer).hide();
console.log('transLayer hide'); // this is being logged
$('#header .nav .wrapper > ul > li.expand').hover(function(){
overExpand = true;
console.log(overExpand);// this works = true
}, function(){
overUl = true;
});
console.log(overExpand); // this shows false