Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kairichard/jquery_cyclearray
Like an iterator but different - lets you cycle trough an array with a function
https://github.com/kairichard/jquery_cyclearray
Last synced: 1 day ago
JSON representation
Like an iterator but different - lets you cycle trough an array with a function
- Host: GitHub
- URL: https://github.com/kairichard/jquery_cyclearray
- Owner: kairichard
- Created: 2012-07-09T09:47:34.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-07-09T10:04:18.000Z (over 12 years ago)
- Last Synced: 2023-04-12T15:06:43.006Z (almost 2 years ago)
- Size: 97.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
jquery_cycleArray
=================Like an iterator but different - lets you cycle trough an array with a function
jQuery.cycleArray([1,2,3],function(){ console.log(this) },2000).start()
// Logs an element every 2secs
jQuery.cycleArray(jQuery('li'),function(){ jQuery(this).trigger('click') },2000).start()
// clicks on element every 2secs// Interfaceing with the cycle
var cycler = jQuery.cycleArray(jQuery('li'),function(){ jQuery(this).trigger('click') },2000)
cycler.next()
cycler.next()
// Starts "auto cycling"
cycler.start()If the cycler encounters the last element its jumps back to the first element and start over again