Problem with animation effect
Hello beautiful people. I have problem with animation effect.
objective:
When the mouse cursor over the button opens the div and occur 2 options:
1 - If I'm inside the div and then the mouse leaves the div closes
2 - If I'm not inside the div and the mouse leaves the div closes
Code:
- $("#button").hover(function(){
- $(this).addClass("active");
- $('#content').slideDown();}
- ,function(event){
- if($('#content').is(":hover"))
- {
- $('#content').slideDown();
- event.stopPropagation();
- return true;
- }
- else {
- $('#content').slideUp();
- $("#button").removeClass("active");
- return false;
- }
- });
- $('#content').mouseleave(function () {
-
- $(this).slideUp();
- $("#button").removeClass("active");
- });
-
- $('#content').hover(function(event) {
- event.stopPropagation();
- });
mikepianist.-