You need to wrap your code in a ready handler, plus you also need to wrap your strings with quotes.
You also seem to have a broken function set-up as Hellion has stated, you shouldn't be passing jQuery into a function at the point you are doing. Instead you need to be wrapping all your code in an annonymous function, with a $
as a param, and pass jQuery into that. This is so as to protect against other libraries that may make use of a global $
var.
Three things that will help you detect these problems in future.
- be specific with your indenting. This will highlight problems much more easily.
- Use a text editor with syntax/code highlighting - this will show you that your strings are wrong.
- check your error console in which ever browser you use, this would have given you some hints as to the illegal syntax layout.
The following should fix your issues:
;(function($){
$(function(){
$('#container5').hover(
function(){
$('#container5').animate({
height: "250",
width: "250",
left: "-=50",
top: "-=50",
},"fast");
},
function() {
$('#container5').animate({
height: "200",
width: "200",
left: "+=50",
top: "+=50",
},"fast");
}
);
});
})(jQuery);