Javascript fade in fade out without Jquery and CSS3

前端 未结 6 538
南方客
南方客 2020-12-03 11:28

I am really squeezing my head to make the simple fade in and fade out of the background image work only with javascript without JQuery and CSS3. I know how easy is to call a

6条回答
  •  臣服心动
    2020-12-03 11:50

    If you do not care about IE7 - IE9, you can use very useful CSS3 transitions, something like this:

        .element {
            -webkit-transition: opacity 0.3s ease;
        }
        .element[faded=true] {
            opacity: 0;
        }
    

    You will get very fast, native fade out effect without jQuery.

    UPDATE: Sorry, i hadn't read quiestion title thoroughly.

提交回复
热议问题