Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animations are not working on mobile #114

Open
rudtek opened this issue Nov 2, 2022 · 0 comments
Open

Animations are not working on mobile #114

rudtek opened this issue Nov 2, 2022 · 0 comments

Comments

@rudtek
Copy link

rudtek commented Nov 2, 2022

Is there a way to get it to animate when on phones? I've tried both android and iPhone.

I have an sal-init.js file which has this line:


const animation = sal();
const switchAnimations = () => {
  if (window.innerWidth < 768) {
    animation.reset();
    animation.disable();
  } else {
    animation.reset();
    animation.enable();
  }
};
switchAnimations();
window.addEventListener('resize', switchAnimations);

However if I delete this file then none of my divs that have Sal attached are visible on mobile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant