javascript - How to solve the problem of flickering when dynamically replacing images based on time?
仅有的幸福
仅有的幸福 2017-05-19 10:16:06
0
3
603

The seedlings in the picture have three growth states. Use the countdown method to dynamically change the src in the img tag.
It performs well on Android. On iOS, it counts once and the seedlings flash once.
I don’t know the reason. Can I ask for a solution?

js is written like this (very scumbag, don’t spray~)

仅有的幸福
仅有的幸福

reply all(3)
我想大声告诉你
  1. First, preload the image

  2. Just change the src attribute of the image every time to reduce unnecessary rearrangements

我想大声告诉你

Combine the picture into a Sprite picture and modify the display coordinates of the picture

过去多啦不再A梦

Image preloading is the key

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template