A simple, lightweight way to add an image comparison tool to your website/app
npm i image-dragger
import { ImageDragger } from 'image-dragger';
ImageDragger.create("#car", {
leftImage: "./demo/images/car.jpg",
rightImage: "./demo/images/car-bg-removed.png",
});
Parameter | Description |
---|---|
selector |
Selector of where you would like to mount the slider |
options.leftImage |
URL of the image you would like to be on the left side of the slider |
options.rightImage |
URL of the image you would like to be on the right side of the slider |