0

我正在尝试将 AJAX 添加到 JQuery 列表视图闪烁黄色,但我似乎无法让它工作。谁能指出我正确的方向?

http://jsfiddle.net/zFybm/

4

2 回答 2

0

使用此代码..它工作正常

function newitem(){
var text='<li><p>new</p></li>';
var elem=$(text);
elem.css("background", "#FFA");
$('#list').prepend(elem);
$('#list').listview("refresh");
elem.animate({backgroundColor: "#EEE"});
}
newitem();​
于 2012-05-31T04:31:32.067 回答
0

根据jQuery页面,

“宽度、高度或左侧可以设置动画,但背景颜色不能设置,除非使用 jQuery.Color() 插件)” http://api.jquery.com/animate/

您可以查看 jQuery.Color(),或使用以下其他解决方案之一:

http://www.bitstorm.org/jquery/color-animation/

http://desizntech.info/2009/06/playing-with-jquery-color-plugin-and-color-animation/

于 2012-05-30T17:44:15.133 回答