Jquery animate bottom problem

Posted by andrea on Stack Overflow See other posts from Stack Overflow or by andrea
Published on 2010-06-06T23:29:20Z Indexed on 2010/06/06 23:32 UTC
Read the original article Hit count: 324

Filed under:
|
|

It's strange. I have an animation that start when i .hover on a DIV. Into this div i have another in position absolute that i want to move up until the mouse stay on main div and go down in your position when i go out of main div. A simple hover effect. I have write down this function that work well apart a strange bug.

         var inside = $('.inside')

         inside.hover(function() {
             $(this).children(".coll_base").stop().animate({
               bottom:'+=30px'
             },"slow")
          }, function() {
             $(this).children(".coll_base").stop().animate({
               bottom:'-=30px'
             },"slow");
          });

i need +=30 and -=30 because i have to apply this function to a range of div with different bottom. The problem is that if i hover on and out of div the DIV animate right but when go down he decrease the value of bottom every animation. If i go up and down from the main div i see that the animated div go down even beyond the main div. I think that i miss something to resolve this bug. Thanks for any help

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about animate