javascript - I found a strange problem. The css animation I wrote automatically paused when I closed the tab.
给我你的怀抱2017-06-30 09:52:30
0
1
835
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?
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.
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
orvisibility
to hide it after folding it.