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

后端 未结 9 1151
一生所求
一生所求 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:04

    jquery:

     $("div").fadeTo(1000 , 1);
    

    css

        div {
         background: url("../images/example.jpg") no-repeat center; 
        opacity:0;
        Height:100%;
        }
    

    html

提交回复
热议问题