This seems to be a mistake. The W3 documentation suggests that hidden visibility has the following effect:
The created box is invisible (completely transparent, nothing is drawn), but it still affects the layout. In addition, the descendants of the element will be visible if they have: visible.
Therefore, it should still be calculated, just not drawn. Obviously, the browser will probably want to make savings and not calculate it where possible, which seems to happen where an error occurs, when this calculation does not resume when necessary. You can get around this by switching the display and wrapping your animated element in a div of the same size as the element to prevent the layout from merging. Otherwise, you can simply reapply the animated CSS by switching the class as specified in Jeff.
See the JS script showing the hidden element, still clearly animated: JSFiddle . It makes me think this is a mistake. Otherwise, the following is an example of its operation with display switching.
setTimeout(function () { $("img").hide(); activate(); }, 3000); function activate() { setTimeout(function () { $("img").show(); }, 3000); }
.image-wrap { height: 200px; width: 200px; } @-webkit-keyframes imagebulger { to { -webkit-transform: scale(.75); transform: scale(.75); } } @keyframes imagebulger { to { -webkit-transform: scale(.75); transform: scale(.75); } } img { -webkit-animation: imagebulger 1.4s infinite alternate; -moz-animation: imagebulger 1.4s infinite alternate; -o-animation: imagebulger 1.4s infinite alternate; animation: imagebulger 1.4s infinite alternate; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <div class="image-wrap"> <img src="http://placehold.it/200x200" /> </div>
source share