Skip to content

edgarberm/superlooper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

superlooper

Superlooper is not a carousel... is not a slider... it is not a paging plug-in. Superlooper simply is a class for paging data from an Array, the implementation is up to you.

Use

// Some fake data
const fakeData = [0, 1, 2, 3, 4 ... ]

/**
* Create Superlooper object
* @param {Array} data to paginate
* @param {Number} items to show per page
**/
const superlooper = new Superlooper(fakeData, 6)


/**
 * API methods
 */

// Initialize. Returns index 0
superlooper.initialize()

// Next
superlooper.next()

// Previous
superlooper.prev()

// Go to especific index (normalized!)
superlooper.goTo(6)

Example

You can see in action here.

About

Provide infinite loop pagination for Arrays

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published