i have an image. if you mouseover it, the controls for next img and previous image appear, displayed on the image (moved there via css). if i mouseout the image the controls, shell disappear.
the problem is, if i mouseover one of the controls i mouseout the image and the controls disappear :-(
how can i handle that? i tryed something like that, but it doesn't do the trick: var control = false;
$('.detail_img').bind('mouseover', function(){
$('.gal_control').fadeIn(200);
});
$('.detail_img').bind('mouseout', function(){
if(!control) $('.gal_control').fadeOut(400);
});
$('.gal_control').bind('mouseover', function(){
control = true;
});
$('.gal_control').bind('mouseout', function(){
control = false;
});
thanks for helping me
the html ... for all with no fantasy :-)
<div class="rollover_left gal_control"></div>
<div class="rollover_right gal_control"></div>
<img class="detail_img" id="detail_img" src...>
UPDATE
var control = false;
$('.detail_img').bind('mouseover', function(){
control = true;
$('.gal_control').fadeIn(200);
});
$('.detail_img').bind('mouseout', function(){
control = false;
});
$('body').bind('mouseover', function(){
if(!control) $('.gal_control').fadeOut(400);
});
$('.gal_control').bind('mouseover', function(){
control = true;
});
$('.gal_control').bind('mouseout', function(){
control = false;
});
i mean, this does the trick now, but is there a better way? can i optimze those lines?