Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Pre-loading images.

ANSWERED

I have a few frames on animation (PNGs). I change the href to animate through the frames with setInterval().

 

It works fine except for the first time each image is loaded and it takes a fraction of a second to show, so the first time through the sequence it flickers to the background colour. Once it has shown the image once it will appear instantly the next time, and the animation appears smooth.

 

Is there a way to pre-load images?

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

You could use multiple <image> tags, and just show/hide them. The next firmware has some performance improvements too, so it may not be an issue then.

View best answer in original post

Best Answer
0 Votes
4 REPLIES 4

You could use multiple <image> tags, and just show/hide them. The next firmware has some performance improvements too, so it may not be an issue then.

Best Answer
0 Votes
It would significantly over complicate what I'm doing. I'll hang on for the next firmware and see how it goes.
Best Answer
0 Votes

Is the new firmware update that does this out yet?

Best Answer
0 Votes

Yes, there have been a few updates since then.

 

Take a look at the Sprite Image component https://dev.fitbit.com/build/guides/user-interface/svg-components/other/#sprite-image

Best Answer
0 Votes