Reputation: 29
i have a jquery login drop down
I use this code to show the login <div>
:
$(document).ready(function() {
$('.vv2').hover(function() {
$('#boxa').slideDown('slow');
});
});
I want to know how to hide it again if the user go away from the login area.
the code here http://www.sprnt.net/sprnt/
the first button in the top left screen
Upvotes: 3
Views: 117
Reputation: 32050
It's very easy ref: Hover to handle mouse move jQuery slide Up and jQuery slide Down
Upvotes: 0
Reputation: 10685
$(document).ready(function() {
$('.vv2').hover(
function() {
$('#boxa').slideDown('slow');
},
function() {
$('#boxa').slideUp('slow');
}
);
});
just wanted to tell, hover event takes two functions. See here jquery Docs
Upvotes: 0
Reputation: 3446
$(document).ready(function(){
$('.vv2').mouseout(function(){
$('#boxa').slideUp('slow');
});
});
Upvotes: 0
Reputation: 1948
Try this:
$(document).ready(function(){
$('.vv2').hover(function(){
$('#boxa').slideDown('slow');
}, function(){
$('#boxa').slideUp('slow');
});
});
When using hover, you can pass 2 functions, the first for mouseOver and the second for mouseOut.
Upvotes: 3