jQuery fading two images without white

前端 未结 4 954
予麋鹿
予麋鹿 2020-12-19 20:19

I would like to fade image without white transfer between them.

HTML:

4条回答
  •  渐次进展
    2020-12-19 21:13

    Instead of fading out one image and then fading in another, use two image elements and layer them on top of each other, then just fade out the top one to make the bottom one appear instead.

    CSS:

    .image img { position: absolute; left: 0; top: 0; }
    

    HTML:

    Javascript:

    $('.topImage').fadeOut(3000);
    

    Demo: http://jsfiddle.net/Guffa/grTUK/

提交回复
热议问题