jQuery animate() not working with colors

回眸只為那壹抹淺笑 提交于 2019-11-28 00:36:14

问题


I'm trying to do some simple jQuery test in Confluence 4.1.9.

$("div#test").css("background","#F00");

works, but

$("div#test").animate({background:"#F00"});

doesn't. Am I missing something? Or maybe animate() just doesn't work in Confluence? Hopefully someone can help me out with this. Thank you.

[Update]

Thank you guys, it totally worked! But fyi, it did not work in preview, which made me scratch my head a bit. Good thing I decided to save the page and see what happens anyway. :P


回答1:


jQuery Core does not support color animations out of the box.

You will have to use something like jQuery UI or a standalone jQuery Color plugin for your call to animate() to work as expected.



来源:https://stackoverflow.com/questions/13461984/jquery-animate-not-working-with-colors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!