I have developed LCD display like widget, I have 10 digits images and for every digit on display ( max 6 ) I have and on click I change picture on div ( jquery attr(‘src’,’url’). My question is how to load all this 10 images in ready function ? I need to avoid flickering if connection is slow ( It flicker first time ) ?
Share
The best way would be to create a “sprite”.
A sprite is a single image that has all those digits stacked, and you’ll then apply different
background-position‘s according to which digit you want.You can use spriteme.org to help you with creating the sprites.
Here’s one I’ve made some time ago for one of my projects: