A vanilla JavaScript Mobile-Friendly Before/After Comparison Slider | iMatch.js

iMatch.js is a before / after comparison slider for vanilla JavaScript for mobile, to display the difference between two images using drag and touch events of the mouse.

beforeafter image slider online, before after slider, image comparison slider, before after slider codepen, image comparison slider online,, before after slider banner jquery plugin

More advantages:

  • Both desktop and mobile
  • Built-in animation
  • Touch support
  • It’s easy to customize the CSS style
  • Compatible with mobile
  • Easy to integrate
  • Both horizontal and vertical slats

How to make use of it:

1. Import the minified version of the iMatch.js JavaScript library.

<script src="./dist/imatch.min.js"></script>

2. Or import the iMatch.js as an element.

import  { iMatch } from '../dist/imatch.min.js'

3. Add before/after photos to the iMatch container.

<div class="example">
  <img data-caption="Before" src=" " alt="image One">
  <img data-caption="After" src=" " alt="image Two">

4. Create a hidden range input to deal with the on-input event.

<input hidden type="range" name="" id="range" min="0" max="100">

5. Initialize the picture comparability slider.

var mySlider = new iMatch('.example')
  direction: 'horizontal',
  animation: true,
  lineClassName: 'line',
  arrowClassName: 'dot'

6. Customize the picture comparability slider within the CSS.

  /* styles for drag handle */

  /* styles for slider */

  /* styles for labels */

Compare Before/After Images With Drag & Touch Events, iMatch.js Plugin/Github, beforeafter image slider app

iMatch js Demo

See Demo And Download

Official Website(indaneey): Click Here

This superior jQuery/javascript plugin is developed by indaneey. For extra advanced usage, please go to the official website.

Related Posts


Responsive Drag and Drop File Uploader/Download Plugin | 5x5_jq_uploader

5x5_jq_uploader plugin can be used to instantly create a drop file area and file queue with a little bit of preparation. Bootstrap is used for responsive planning…


Stylesheet For Implementing Dark Mode with Bootstrap

Bootstrap Dark Mode provides a style sheet and two texts that allow you to implement Dark Mode on your website. Initially loaded based on user preferences, can…


Multi-purpose Navigation Menu for Javascript Library | jQuery Corenav

coreNavigation is a multipurpose navigation menu for a jquery based javascript library, comes with more style, and is easy to integrate. 11 Default Menu 2 Responsive Navigation…


Simple Multi-Select Dropdown Pure Vanilla Javascript | multiSelect.js

MultiSelect.js is a simple, clean, and progressive JavaScript library designed for easy integration with any type of project or system. The design was heavily influenced by the…


Confetti Falling Animation Effect In JavaScript | party.js

Party.js is a JavaScript library to brighten user site experience with visual effects! Celebrate success with dom confetti! The library is written in TypeScript and compiled into…


How To Create A Popup in HTML with CSS

How to create popup in html with css – Popup without JavaScript is an elegant pop-up panel component with an animated scale, written in CSS. Have you…