image-comparison
v2.0.4
Published
Slider to quickly compare two images
Downloads
934
Maintainers
Readme
ImageComparison
Slider to quickly compare two images
Install
$ npm install image-comparison
Connection
JavaScript
CommonJS
import { ImageComparison } from 'image-comparison';
AMD
require(['ImageComparison'], function (ImageComparison) {
// Usage
});
CSS
<link rel="stylesheet" href="node_modules/image-comparison/src/ImageComparison.css">
Usage
<script>
new ImageComparison({
container: containerSelector,
startPosition: 70,
data: [
{
image: images[0],
label: 'before'
},
{
image: images[1],
label: 'after'
}
],
});
</script>
Options
Options list:
Browsers support
Chrome, FF, Opera, Safari, IE10+
Example
See example - ImageComparison