Otto
Otto

Reputation: 119

scrollSnap js resistance with mousewheel

I'm using https://github.com/electerious/scrollSnap to snapping sections in my website but i'm not understand because there is a resistance between mosaic grid and section below when i use mousewheel.

If i use scrollbar i can snap between sections under mosaic.

<script>
  scrollSnap.init({
    elements: document.querySelectorAll('section'),
    minWidth: 600,
    minHeight: 400,
    detectMobile: true,
    keyboard: true,
    duration: 20,
    timing: scrollSnap._timing
  })
  </script>

Upvotes: 0

Views: 571

Answers (1)

DannyThunder
DannyThunder

Reputation: 1004

because you "snap" it to <section>, and your "upper html" is <div>. Wrap all your sections you want to be "snapable" inside of <section></section>.

Upvotes: 1

Related Questions