javascript - How to show an background image until the image loads -


if create photo gallery page in image slow connections images not load fast.

how can create such page in image loads first applied backgrounds of images until loads , cover light image loaded earlier.

you can apply background image. if jpg (with no trasparency), this:

css

   img{       background: url(path/to/my/file.jpg) center center no-repeat;    } 

note if have trasparency, image appear on background , not beautiful. else, should work charm way.


Comments

Popular posts from this blog

android - How to save instance state of selected radiobutton on menu -

python 3 IndexError: list index out of range -

IF statement in MySQL trigger -