SwiperJS Integration

Demonstrates `useSwiper` option. Include SwiperJS via CDN to enable touchscreen control for your timelines. If Swiper fails to load, Vantl falls back to the built-in carousel UI.

To use this demo, you have to load it on a touchscreen-enabled device and swipe to navigate!

Note: while SwiperJS works with Vanilla Timeline, we don't officially support it. Please visit SwiperJS for help with features or issues.

Javascript code:


     // First, make sure you have the CSS file loaded in the document <head>:
     <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@12.4.7/swiper-bundle.min.css" />

     // When SwiperJS is available (either via CDN or installed), use `useSwiper: 'auto'` or `true` in Vanilla Timeline
     // Example CDN (include BEFORE timeline.min.js for UMD global):

     <script src="https://cdn.jsdelivr.net/npm/swiper@12.4.7/swiper-bundle.min.js"></script>
    
     // Example usage:
     timelineFromData('#swiper-tl', items, {
       useSwiper: 'auto',
       swiperOptions: { loop: true, keyboard: { enabled: true } }
     });
    

View the Source Code of this page to see how SwiperJS was integrated to work with Vanilla Timeline