Jquery Height Wrong
2011
jquery height wrong
[JQUERY] animate() method doesn’t work with images?
Hiya, I’d like to create a div with a height of 25px that increases to 50px when the user hovers over it, and again to its original size when the user hovers out of it. Inside the div are some links and it would be really helpful if it was partially hidden when the user wasn’t targetting the div.
I did this with a onmouseover/onmouseout event using jquery’s animate() method. on its own this works fine, yet when I put images inside that div, things start to go wrong. the div resizes on mouseout AND when it hovers over an image, and the div should stay the same (50px) when hovering over an image.
I already tried to remove the links from the images, to put a div around them, and even to use the .hover(mouseover,mouseout) jQuery method, nothing helps. Anyone knows a solution for this problem?
P.S: No, I’m not going to do it with CSS hover, I want a nice animation!
P.S2: I don’t think posting my source code is really neccesary as it’s only a few lines of code.
Events are passed from contained object (your object) to their container (your div) until they are handled. There are several ways to prevent that, but in your case I would try adding onmouseout=”return false;” and onmouseover=”return false;” to your images.
Google I/O 2010 – Developing With HTML5
Since you found this site, I assume you are interested in gaining a few extra inches of height. Although (if you’re a mature adult) this may sound like a pipe dream, I assure you that it is easier than you think! We’ve all been taught that height is mostly out of our control, that it’s largely determined by genetics. I’m here to tell you that there is more to the story. Of course our gene pool has a lot to do with ones height, but it is definitely not the only factor. Your state of emotion, your exercise regimen, the food you eat, and the hours you sleep are all factors in height determination. Click here to read the rest of the article: Free Height Enhancement

Comment