A simple jquery plugin for creating image comparison sliders.
Getting started
Download the code from here
Unzip and include the files on your page
<link rel="stylesheet" type="text/css" href="./css/imgslider.css">
<script type="text/javascript" src="./js/imgslider.js"></script>
HTML decoration for your images goes like this
<div class="slider">
<div class="left image">
<img src="before.jpg"/>
</div>
<div class="right image">
<img src="after.jpg"/>
</div>
</div>
Include the following near the end of the page.
<script type="text/javascript">
$('.slider').slider();
</script>
Known Issues
- Touch events haven’t been added yet. It may not work as expected on tablets and phones
- Files have not been minified
imgSlider : jQuery plugin for creating Image Comparison
No comments:
Post a Comment