i have some syntax problem… This is my little script:
$('.basket_details, .advanced_search_panel, .producers_major_panel').hover(function () {
mouse_is_inside = true;
}, function () {
mouse_is_inside = false;
});
$("body").mouseup(function () {
if (mouse_is_inside) {
$('.advanced_search_panel, .producers_major_panel').fadeOut('slow');
$('.basket_details').slideUp('slow');
}
});
everything’s fine but my chrome console screaming that i have syntax errors, and mouse_is_inside is not define, how to correct this mistake?
Try a closure:
This will allow you use of ‘mouse_is_inside’ within the scope of the functions. It also stops you from needing to use a global.