1
当我将鼠标悬停在按钮上时,背景颜色不变。。jQuery中的动画不起作用
我的jQuery:
<script type="text/javascript" src="/js/jquery.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function(){
$(".reject").hover(function() {
$(this).animate({background: '#000'}, 1000);
}, function(){
$(this).animate({background: '#333'}, 1000);
});
});
</script>
<style type="text/css">
.reject{padding:10px;font-size:20px;background:#F00;}
</style>
我的HTML:
<button class="reject">Reject</button>
我缺少什么?
http://stackoverflow.com/questions/190560/jquery-animate-backgroundcolor –
请格式化你的代码,以便其他人可以阅读并帮助你。 –
这里的第一个评论是答案。 – maxedison