开发者

mouseOut effect with a mask

开发者 https://www.devze.com 2023-01-22 05:57 出处:网络
The following cod开发者_如何转开发e 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

The following cod开发者_如何转开发e 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.

<script> 

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

    });
});
</script>


$(function() { 

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

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

});


Or more succinctly:

$("#menuwrapper").hover( 
  function(){ $(this).expose(); },
  function(){ $(this).hide(); } // opposite of expose() function
);


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
);
0

精彩评论

暂无评论...
验证码 换一张
取 消