Advance customization

jCoverflip provides a robust API to customize the animation and methods to use in creating your own controls.

Options

Name Description
items The jQuery element selector: string, jQuery, DOM Element, [DOM Element]
beforeCSS A function to customize the styling and animation for items to the left of the current.
afterCSS A function to customize the styling and animation for items to the right of the current.
currentCSS A function to customize the styling and animation for the current item.
current

The item to be current.

time

The time, in milliseconds, to animate when switching from item to item.

titles.create

A function to generate a title element for the items. (Paired with titles.destroy)

titles.destroy A function to remove the title element for the items when the object is being destroyed. (Paired with titles.create)
titleAnimationIn

A callback function to animate the title in.

TitleAnimationOut

A callback function to animate the title out.

controls.create

A callback to add controls, such as a scrollbar, to the jCoverflip widget. (Paired with controls.destroy)

controls.destroy A callback to remove the controls when the object is destroyed. (Paired with controls.create)

 

Methods

Call Description
next( [by=1], [wrapAround=true], [callback], [originalEvent={}])

Move to the next item.

  • by: the number to move ahead by
  • wrapAround: wraps back around to the start if exceeds the number
  • callback: a function to get called
  • originalEvent: the originating event object
previous( [by=1], [wrapAround=true], [callback], [originalEvent={}])

Move to the previous item.

  • by: the number to move back by
  • wrapAround: wraps back around to the end if exceeds the number
  • callback: a function to get called
  • originalEvent: the originating event object
last([callback], [originalEvent={}])

Move the current to the end.

  • callback: a function to get called
  • originalEvent: the originating event object
first([callback], [originalEvent={}])

Move the current to the start.

  • callback: a function to get called
  • originalEvent: the originating event object
current([newCurrent, [originalEvent]])

Get the current item index if no parameters are passed. If newCurrent is passed, then it will move the current item to the index.

length

Get the length of the number of items.

Events

Name Description
change

Triggers when the current item changes.

start

Triggers when starting to change the current item.

stop

Triggers when stopping to change the current item.

next Triggers when the next method is called.
previous Triggers when the previous method is called.
first Triggers when the first method is called.
last Triggers when the last method is called.