question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Animations do not work when HTML5 video element is on page, above animated elements

See original GitHub issue

This is:

  • Bug

Specifications

  • AOS version: latest
  • OS: windows
  • Browser: firefox

Expected Behavior

Elements should animate regardless of other elements present on page.

Actual Behavior

Animations do not work when HTML5 video element is on page, above animated elements

Steps to Reproduce the Problem

  1. Here is my video code. You can live edit/add it to the main AOS page (https://michalsnik.github.io/aos/) as a test.
<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>
  1. If you place that video element near the top, the subsequent animated items will not animate.
  2. If you place that video at the bottom of the page, the animated items above it will animate.

Detailed Description

Possible Solution

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

3reactions
colepacakcommented, Dec 21, 2018

I ran into the same problem in safari - particularly mobile safari - and this helped me:

AOS.init();

window.addEventListener('load', function() {
  AOS.refresh();
});
0reactions
Foulks-Plbcommented, Aug 16, 2022

The problem is solved for me: I do: AOS.refresh(); when video is ready with event…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Animate on Scroll (AOS) animations do not work when HTML5 ...
I have an HTML5 video element on my page, and my animations are not working. They work on every other page of the...
Read more >
CSS Animations Not Working? Try These Fixes - HubSpot Blog
Learn how to fix common CSS animation error and get your animations looking how you want them.
Read more >
Animations do not work when video element is on page - Drupal
Hello, I have an HTML5 video element on my page, and my animations are not working. They work on every other page of...
Read more >
The Video Embed element - HTML - MDN Web Docs - Mozilla
In some browsers (e.g. Chrome 70.0) autoplay doesn't work if no muted attribute is present. autopictureinpicture Experimental. A Boolean ...
Read more >
How to Make HTML Videos Run Smoothly - SherpaDesk
Generally yes, but the complexity of HTML5 arises not from the syntax, but from browser support and video encoding. Web developers are used...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found