1.0.2 • Published 3 years ago

image-switcher v1.0.2

Weekly downloads
8
License
MIT
Repository
github
Last release
3 years ago

code style: prettier

Image Switcher

Image Switcher Screenshot

Add image-switcher to toggle on action.

  • No localStorage, only DOM

Installation

npm i image-switcher

Usage

  1. Load image-switcher.min.js at the foot of your page:
<script src="image-switcher.js"></script>
  1. Add ID to your image switch action:
<a href="#" id="image-switcher-action">
    Switch image
</a>
  1. Add image sources and class to your image tag to switch:
<img class="image-switcher" src="images/1232.jpg" data-switch-src="images/1266.jpg">
  1. Add animation on images from animate.style:
<a href="#" class="image-switch-animation" id="image-switcher-action">
    Switch image
</a>
<img class="image-switcher" src="images/1232.jpg" data-switch-src="images/1266.jpg" data-animation="bounce">