views:

39

answers:

3

Ok so the following code produces a mask on a web page when hovering over a menu, my question is how do I edit this code to make the mask go away with mouseout event? As it sits now I have to click for the mask to go away. Any help is appreciated, thank you.

<script> 


$(function() {


    $("#menuwrapper").mouseover(function() {


        $(this).expose();

    });
});
</script>
+1  A: 
$(function() { 

    $("#menuwrapper").mouseover(function() {      
        $(this).expose();  
    });

  $("#menuwrapper").mouseout(function() {     
        $(this).hide();  
    });

});
Diodeus
This made my menu disappear altogether and the mask remained on the screen.
NewB
+1  A: 

Or more succinctly:

$("#menuwrapper").hover( 
  function(){ $(this).expose(); },
  function(){ $(this).hide(); } // opposite of expose() function
);
Ken Redler
still functioned but didn't remove the mask
NewB
Perhaps you need to attach the mask hiding function to the mouseout event of the mask itself. Without knowing more details it's hard to say.
Ken Redler
A: 

If you are using the expose library, you can setup the event like this:

$("#menuwrapper").hover( 
  function(){ $(this).expose(); },
  function(){ $(this).unexpose(); } // opposite of expose() function
);
Ed Saito
The link you provided doesn't work. Also, this kind of functionality is easily achieved with the jQuery framework itself (which is what newB is using).
Derek Adair