michalsnik / aos

Animate on scroll library
MIT License
26.81k stars 2.59k forks source link

Trigger horizontal scroll #534

Open gvallee70 opened 4 years ago

gvallee70 commented 4 years ago

This is:

Specifications

Expected Behavior

No trigger of the horizontal scroll or no page shift when animation are triggered.

Actual Behavior

When there is animations on elements, it trigger the horizontal scroll. I did "html { overflow-x: hidden;} but when i F5 the page, website is shifted to the left.

Steps to Reproduce the Problem

1. 2. 3.

Detailed Description

Possible Solution

infabo commented 4 years ago

+1

davilink92 commented 4 years ago

Hi, did your resolve?

guschiavon commented 4 years ago

I have the same issue. I'm calling a jQuery method which seems to be interfering:

$(window).on('scroll', function () {
    if ($(this).scrollTop() > 200) {
      if (!$('.nav-bar').hasClass('navbar-scroll')) {
        $('.nav-bar').addClass('navbar-scroll');
      }
    } else {
      if ($('.nav-bar').hasClass('navbar-scroll')) {
        $('.nav-bar').removeClass('navbar-scroll');
      }
    }
  });

If I comment this out, it works like a charm. Any suggestion for a workaround?