Reputation: 2466
Here is my code: http://jsfiddle.net/sZKeM/1/
So basicly it shows box when I hover button and when I hover out from box it will hide. I want to hide box when I hover again the button and if I hover again it will show box again.
$('.btn').mouseenter(function(){
$('.box').css('display','block');
});
$('.box').mouseenter(function(){
$('.box').css('display','block');
});
$('.box').mouseleave(function(){
$('.box').css('display','none');
});
Upvotes: 0
Views: 179
Reputation: 12431
It's difficult to understand exactly what you want from your question and comments. Is this the behaviour you're looking for:
Upvotes: 1
Reputation: 8641
$('.btn').mouseenter(function(){
var visible = $('.box').css('display') == "block"
$('.box').css('display',visible ? '' : 'block');
});
Upvotes: 0