Reputation: 47625
Apologies if this doesn't qualify as a StackOverflow question.
I have a jpg of a sign that's made up of 100 light bulbs. I'd like to use jQuery to animate the bulbs so that they flicker on after a moment's hesitation.
I'm thinking that it would require two images and that I would animate hiding/showing them back and forth to produce the flicker, but I wanted to ask if there was a more elegant solution first.
Upvotes: 3
Views: 257
Reputation: 22717
If you made the lights in the image transparent (with alpha-blending, you could keep the reflective parts of the light so it looks right).
Then, you could place the image on a properly sized div, and set the background color of that div to whatever you like -- it will become the color of the lights.
(I've never done this, but it sure doesn't seem like you'd hit anything that should prevent you from doing it.)
Upvotes: 1
Reputation: 19765
Seems like you could do something with an overlaying-div with opacity that you vary to 'flicker' the lights. Position the div so it is 'on top of' the lights. Then, hide it to be 'on'.
Upvotes: 1