Will an image with style=“display: none” still be downloaded and cached?

前端 未结 3 1627
逝去的感伤
逝去的感伤 2021-02-19 02:19

I\'m trying to figure out a way to cache the next and previous images in my gallery script ... I\'m wondering if this is a good way to do it. Also, is there any way to manually

3条回答
  •  北荒
    北荒 (楼主)
    2021-02-19 02:40

    I think it will be downloaded, and hence cached, because the images may be loaded before the CSS has even arrived.

    If browsers turn out to be too smart, something like position:absolute; left:-9999px; top:-9999px should be a nice alternative.

提交回复
热议问题