Why doesn't JQuery hover animate work in this example
Posted
by Christian
on Stack Overflow
See other posts from Stack Overflow
or by Christian
Published on 2010-05-20T17:52:13Z
Indexed on
2010/05/20
18:00 UTC
Read the original article
Hit count: 191
jQuery
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>
© Stack Overflow or respective owner