Can you stop an

后端 未结 5 1715
鱼传尺愫
鱼传尺愫 2021-02-18 21:43

Is there any way to stop an tag loading its image by just using CSS? I would like to avoid using JavaScript.

This doesn\'t seem to work (Firebu

5条回答
  •  庸人自扰
    2021-02-18 22:06

    You then set them all to be

        .img{visibility:hidden;} 
    

    this will prevent them from making an http request but still preserves their size and spacing in the document preventing any redraws.

    then when you want to show your hidden images (for instance the ones in view) you add a class to the surrounding html element and in your css tell this to be

        .show .img {visibility:visible;}
    

    That should do it, Holmes.

提交回复
热议问题