开发者

jquery: animate $('id1').before('some html') to fadeIn and from red to transparent

开发者 https://www.devze.com 2022-12-29 20:59 出处:网络
I want to make something just like on this site (when you/or somebody else adds an answer) the answer appears and fades in and comes from orange to transparent, anybod开发者_如何学编程y knows how ?Yo

I want to make something just like on this site (when you/or somebody else adds an answer)

the answer appears and fades in and comes from orange to transparent, anybod开发者_如何学编程y knows how ?


You can get the color plugin and animate the background color of whatever element you want, like this:

$("#myDiv").animate({ backgroundColor: "white" }, 1000);

This will fade it from whatever color you set it to initially (or via .css() just before the animate) to the color you specify over 1 second. You can try the other color plugin demos here.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号