Will an image load if it has its CSS set so that visibility is hidden?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Yes, it will still be loaded and held within the DOM. Then you can show it quickly with JS!
回答2:
Yes - I have used this to preload images that will be shown with Javascript.
You can verify this experimentally:
visibility: hidden
回答3:
Different browsers may behave differently.
回答4:
This depends entirely upon the browser and its environment (e.g., low memory situations such as mobile phones).