Skip to content
This repository has been archived by the owner on Dec 14, 2020. It is now read-only.

colomolo/comparator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Comparator

Interactive comparing widget

Demo

Installation

Download:

Include it on your page:

<script src="path/to/comparator.js"></script>
<link rel="stylesheet" href="path/to/comparator.css">

Usage

Add div with class comparator with two img elements inside:

<div class="comparator">
  <img src="path/to/left/image.png">
  <img src="path/to/right/image.png">
<div>

Options

You can add some options via data attributes:

  • data-return — whether to return divider to center when the mouse cursor leaves the area. Possible values: true, false.

-- Drop me a line if you use Comparator.

License

MIT license

Releases

No releases published

Packages

No packages published