开发者

How to animate background-image transition?

开发者 https://www.devze.com 2023-04-05 15:56 出处:网络
I am adding a class to a div that changes the background image: $(\'div\').addClass(\'specialBackground\');

I am adding a class to a div that changes the background image:

$('div').addClass('specialBackground');

The problem is that this effect is rather jarring. I wou开发者_如何转开发ld like to fade between the different background images, and hopefully keep this css in my stylesheet. How can I achieve this?


Take a look here for an example.

A fade effect will work by putting an image over the background and changing its opacity.

0

精彩评论

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