Elements should animate regardless of other elements present on page.
Animations do not work when HTML5 video element is on page, above animated elements
<div class="video-wrapper">
<div class="video">
<video poster="/images/video.png" autoplay="" loop="" muted="" playsinline="">
<source src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" type="video/mp4">
</video>
</div>
</div>
On further inspection and testing, it appears that the animations DO indeed work, but they are triggering too early... I assume because of the full width and result tall height of the video. How can we make sure that AOS takes into account the height of the video element in regards to when animations are being triggered?
aaaaand upon even further inspection, it appears that the issue only occurs when the video element is contained within a parent div. If the video element is just floating in the code (essentially a child of the
element), then the animations run as expected. Still seems like a buggy sort of thing though... why shouldn't it work while contained in a div? Any fix?Here is a fiddle. To see the animations work, remove the
I was able to "fix" the issue by giving the video element an absolute position, and then adding a 1600x900px transparent PNG in the same div to "stretch" the entire parent container.
I ran into the same problem in safari - particularly mobile safari - and this helped me:
AOS.init();
window.addEventListener('load', function() {
AOS.refresh();
});
Most helpful comment
I ran into the same problem in safari - particularly mobile safari - and this helped me: