【问题标题】:JQuery Animation fails randomlyJQuery 动画随机失败
【发布时间】:2009-12-01 09:59:41
【问题描述】:

我尝试在我的站点中实现 jQuery 动画,但是在几秒、几分钟或几小时后随机地,动画会抛出一个错误:“Invalid property value” Line 154 Char 4889 jquery-ui-1.7.2-custom.js。

这是我的代码:

            $(idTimer).animate({backgroundColor: '#aa0000', color: '#ffffff'}, 1000);
            $(idPrice).animate({backgroundColor: '#aa0000', color: '#ffffff'}, 1000);

            $(idTimer).animate({backgroundColor: '#ffffff', color: '#f67802'}, 1000);
            $(idPrice).animate({backgroundColor: '#ffffff', color: '#000000'}, 1000);

当然,ID 设置正确。 动画挂了,这个ID就不会再做动画了,很神秘。请帮忙,很紧急。

这是失败的代码,从 char 4889 开始:

h.elem.style[f]="rgb("+[Math.max(Math.min(parseInt((h.pos*(h.end[0]-h.start[0]))+h.start[0],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[1]-h.start[1]))+h.start[1],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[2]-h.start[2]))+h.start[2],10),255),0)].join(",")+")"}});

【问题讨论】:

  • 我在 jQuery 中的彩色动画也有同样的问题 - 似乎随机彩色动画会停止。希望有人有答案!
  • 您可以在文件中发布第 154 行字符 4889 吗?

标签: jquery


【解决方案1】:

这样试试

$(idTimer).animate({'backgroundColor': '#aa0000', 'color': '#ffffff'}, 1000);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-09-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-15
    相关资源
    最近更新 更多