angelomelonas / vue-scroll-snap

A super simple Vue component that allows fullscreen and horizontal scroll snapping.
MIT License
31 stars 10 forks source link

Add scroll-behavior: smooth #3

Closed AeonFr closed 4 years ago

AeonFr commented 4 years ago

This adds support for smooth navigation between slides using anchor

Example: use <a href="#slide-id"> to go to scroll with id slide-id

// Index.vue
<VueScrollSnap :fullscreen="true">
      <section class="item">
         <a href="#slide-2">Go to slide 2</a>
      </section>
      <section class="item">
        <a name="slide-2" />
          Section 2
      </section>
</VueScrollSnap>