Can I fade in a background image (CSS: background-image) with jQuery?

后端 未结 9 1153
一生所求
一生所求 2020-11-29 00:52

I have a div element with text in it and a background image, which is set via the CSS property background-image. Is it possible to fade in the back

9条回答
  •  执笔经年
    2020-11-29 01:18

    With modern browser i prefer a much lightweight approach with a bit of Js and CSS3...

    transition: background 300ms ease-in 200ms;
    

    Look at this demo:

    http://codepen.io/nicolasbonnici/pen/gPVNbr

提交回复
热议问题