Skip to content

jQuery plugin switches the images while you are holding a mouse cursor on the element.

License

Notifications You must be signed in to change notification settings

SEAFERN/fork_images-rotation_sladex

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

jQuery plugin switches the images while you are holding a mouse cursor on the element.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%