Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Evan Gatchell
5,878 PointsjQuery resize issues
When I mouse over the ".panel" images, it grows by 3 pixels.
However, when I take it off, it shrinks 6 pixels. It gets smaller everytime you mouse over the images.
WTF??
$(document).ready(function() {
$(".panel").mouseenter(function() {
$(this).animate({
height: '+=3px',
width: '+=3px'
}, "fast");
});
$(".panel").mouseleave(function() {
$(this).animate( {
height: '-=3px',
width: '-=3px'
}, "fast");
});
});
Evan Gatchell
5,878 PointsI dunno. Animation just stopped working out of the blue. Grabbed a new jQuery link, and now it's not functioning right. Must be an older version? Annoying...
Marcus Parsons
15,719 PointsI used your exact code with some simple markup I created, and the animation works exactly as intended. If you want to paste the rest of your code, I can try to see what's going on with it.
Evan Gatchell
5,878 Pointshttp://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js
Looks like I'm using 3.5 year old jQuery.
Still donn't know why that wouldn't work. Seems like pretty vanilla code to me.
Evan Gatchell
5,878 PointsThanks for the help. I wouldn't have thought to even look at the version number if not for your comment.
Marcus Parsons
15,719 PointsDo you have other code running besides that?
Marcus Parsons
15,719 PointsAh, so it's working now?
Evan Gatchell
5,878 PointsNot able to fix the error yet, but this is code that functioned perfectly ~3-4 weeks ago. No other JS running. It HAS to be the older version.
Evan Gatchell
5,878 Points(Not at main computer. Will fix bug when I get home later)
Marcus Parsons
15,719 PointsLike I said, if you want to copy and paste your HTML and CSS here, as well, I can take a look at it and see what's going on.
Evan Gatchell
5,878 PointsProblem solved. It was indeed the outdated jQuery. Thanks again.
Marcus Parsons
15,719 PointsOh, that's awesome! Glad you got it solved!
Marcus Parsons
15,719 PointsMarcus Parsons
15,719 PointsHey Evan,
What version of jQuery are you using? I'm using the latest version 2.1.3, and your animation works fine for me.