Reputation: 1173
HTML/CSS/JS here: http://jsfiddle.net/_mtr/XGe8d/2/
My problem is that the animation is taking place at the bottom of the element, not the top. I figure it's an issue with my CSS positioning, but I can't suss it out. And ideas?
Upvotes: 4
Views: 2172
Reputation: 20415
I updated your jsFiddle. I added position: relative to your css and used top(). I also added .stop(true, true) to eliminate queuing issues.
Upvotes: 0
Reputation: 23943
If I understand what you're trying to achieve, one option is to animate padding-top
instead of height
.
Upvotes: 2
Reputation: 5052
Try
$(document).ready(function() {
$("a").hover(
function() {
$(this).animate({
'paddingTop': '+=10px'
}), $(this).animate({
'paddingTop': '-=10px'
});
});
});
Upvotes: 2