Why doesn't JQuery hover animate work in this example
- by Christian
When I hover over the box it doesn't change it's caller as I intent. What's wrong?
<html>
<head><title>test</title></head>
<style type="text/css" >
.box_type1{
width:560px;
height:560px;
background-color:#b0c4de;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.box_type1').hover(
function () {
$(this).stop().animate({backgroundColor:'#4E1402'}, 300);
}, function () {
$(this).stop().animate({backgroundColor:'#943D20'}, 100);
});
});
</script>
<body>
</div>
<div class="box_type1">
</div>
</body>
</html>