Images rotation jQuery plugin
Plugin switches the images while you are holding a mouse cursor on the element. Animates both src
attribute for images and background-image
attribute for any other element.
Live demo: http://sladex.org/images-rotation/
Basic Usage
<div class="images-rotation" data-images='["img/1.jpg", "img/2.jpg", "img/3.jpg", "img/4.jpg"]'> <img src="img/1.jpg" alt=""> </div> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="jquery.images-rotation.min.js"></script> <script> $('.images-rotation').imagesRotation(); </script>
Options
images
Push the images array via Javascript. Default is '[]'dataAttr
Change html5 data- attribute name. Default is 'images'imgSelector
jQuery selector for the element to makes changes for. Default is 'img'interval
Interval between one image switches to another, in ms. Default is '1000'intervalFirst
Time delay for the very first switch. Default is '500'callback
Callback function, first argument would be the current image url. Default is 'null'
Changelog
0.1.2 (2014/08/12)
background-image
support
License
Copyright (c) 2013-2014 sladex, released under the MIT License.