Home  >  Q&A  >  body text

javascript - I found a strange problem. The css animation I wrote automatically paused when I closed the tab.

I found a strange problem. The css animation I wrote automatically paused when I closed the tab, and continued to play when I expanded the tab.
I use the background image to move to achieve the effect of motion. Is it related to this reason?

给我你的怀抱给我你的怀抱2638 days ago763

reply all(1)I'll reply

  • 怪我咯

    怪我咯2017-06-30 09:54:30

    If you set the element to display: none after closing the tab, this element will not belong to the document flow, so it will not be rendered by CSS and animation will not run.

    If this is the case, it is recommended to use opacity or visibility to hide it after folding it.

    reply
    0
  • Cancelreply