小提琴:http://jsfiddle.net/BMJWS/
我想让文本在单击时变红,但由于某些原因,它不起作用:
html:
<div id = 'text'>hi</div>css:
#text {
color:black;
}联署材料:
function turnred() {
$("#text").animate({color: 'red'}, 400);
}
$('#text').click(function() {
turnred();
});发布于 2014-04-18 18:40:57
为了使用彩色动画,您需要包括JQuery UI
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css" />
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>https://stackoverflow.com/questions/23160170
复制相似问题