Building a touch slider from scratch using just JavaScript can be a daunting task. That’s why we are going to use Swiper to build a fast, responsive, and mobile-first touch slider.

Swiper is the default slider component in the Ionic Framework. Swiper uses hardware-accelerated transitions, and its performance is comparable to native apps. Besides this, it is used by some of the biggest companies, such as Adobe and Cisco.

Swiper offers several enticing features such as lazy loading images, parallax effects, and much more. Additionally, you can use libraries like jQuery and Zepto alongside Swiper and also customize Swiper with your own custom CSS.

Let’s get started.

Installation

You can install Swiper using three methods:

  1. Download Swiper and save it locally.
  2. Use CDN to use Swiper by adding the following two lines in between the head tags of your index.html file:
<link rel="stylesheet" href="https://unpkg.com/swiper/swiper-bundle.css">
<script src="https://unpkg.com/swiper/swiper-bundle.js"></script>

3. You can also download Swiper via npm using the npm install swiper command. Make sure you have npm installed on your computer.

I will be using the second option to demonstrate some of the Swiper features below.

#angular #javascript #programming #react #nodejs

Create Mobile-Friendly Touch Sliders
1.40 GEEK