Responsive Image Comparison Plugin With jQuery - before-after.js

File Size: 6.19 KB
Views Total: 5042
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
Responsive Image Comparison Plugin With jQuery - before-after.js

before-after.js is a flexible, responsive jQuery image comparison plugin which allows you to compare two different images in one slider.

See also:

How to use it:

1. Include the jQuery before-after.js plugin's stylesheet in the document's head section.

<link href="before-after.css" rel="stylesheet">

2. Add two images into the 'ba-slider' container as follow.

<div class="ba-slider">
   <img src="before.jpg">
   <div class=" resize">
       <img src="after.jpg">
   <span class="handle"></span>

3. Include jQuery library and the jQuery before-after.js plugin's script at the bottom of the document. That's it.

<script src="//"></script>
<script src="before-after.js"></script>

4. You can also include the jQuery Mobile to enable touch support.

<script src="//"></script>

This awesome jQuery plugin is developed by jotform. For more Advanced Usages, please check the demo page or visit the official website.