$EVT_CLICK function(slideIndex[, event])
$EVT_DRAG_START function(position[, virtualPosition, event])
$EVT_DRAG_END function(position, startPosition[, virtualPosition, virtualStartPosition, event])
$EVT_SWIPE_START function(position[, virtualPosition])
$EVT_SWIPE_END function(position[, virtualPosition])
$EVT_LOAD_START function(slideIndex)
$EVT_LOAD_END function(slideIndex)
$EVT_FREEZE function()
$EVT_MOUSE_ENTER function()
$EVT_MOUSE_LEAVE function()
$EVT_POSITION_CHANGE function(position, fromPosition[, virtualPosition, virtualFromPosition])
$EVT_PARK function(slideIndex, fromIndex)
$EVT_PROGRESS_CHANGE function(slideIndex, progress[, progressBegin, idleBegin, idleEnd, progressEnd])
$EVT_STATE_CHANGE function(slideIndex, progress[, progressBegin, idleBegin, idleEnd, progressEnd])
$EVT_SLIDESHOW_START function(slideIndex[, progressBegin, slideshowBegin, slideshowEnd, progressEnd])
$EVT_SLIDESHOW_END function(slideIndex[, progressBegin, slideshowBegin, slideshowEnd, progressEnd])
$JssorSlider$.$EVT_CLICK
function SliderClickEventHandler(slideIndex, event)
{
//slideIndex: the index of slide which is clicked
//event: native event fired by browser
}
jssor_slider_instance.$On($JssorSlider$.$EVT_CLICK, SliderClickEventHandler);
$JssorSlider$.$EVT_DRAG_START
function SliderDragStartEventHandler(position, virtualPosition, event)
{
//position: real position of the carousel
//virtualPosition: virtual position of the carousel
//event: native event fired by browser
}
jssor_slider_instance.$On($JssorSlider$.$EVT_DRAG_START, SliderDragStartEventHandler);
$JssorSlider$.$EVT_DRAG_END
function SliderDragEndEvenetHandler(position, virtualPosition, startPosition, virtualStartPosition, event)
{
//position: real position of the carousel
//startPosition: real position that drag starts at
//virtualPosition: virtual position of the carousel
//virtualStartPosition; virtual position that drag starts at
//event: native event fired by browser
}
jssor_slider_instance.$On($JssorSlider$.$EVT_DRAG_END, SliderDragEndEvenetHandler);
$JssorSlider$.$EVT_SWIPE_START
function SliderSwipeStartEventHandler(position, virtualPosition)
{
//position: real position of the carousel
//virtualPosition: virtual position of the carousel
}
jssor_slider_instance.$On($JssorSlider$.$EVT_SWIPE_START, SliderSwipeStartEventHandler);
$JssorSlider$.$EVT_SWIPE_END
function SliderSwipeEndEventHandler(position, virtualPosition)
{
//position: real position of the carousel
//virtualPosition: virtual position of the carousel
}
jssor_slider_instance.$On($JssorSlider$.$EVT_SWIPE_END, SliderSwipeEndEventHandler);
$JssorSlider$.$EVT_LOAD_START
function SliderLoadStartEventHandler(slideIndex)
{
//fires before image load
//slideIndex: the index of slide
}
jssor_slider_instance.$On($JssorSlider$.$EVT_LOAD_START, SliderLoadStartEventHandler);
$JssorSlider$.$EVT_LOAD_END
function SliderLoadEndEventHandler(slideIndex)
{
//fires after image load
//slideIndex: the index of slide
}
jssor_slider_instance.$On($JssorSlider$.$EVT_LOAD_END, SliderLoadEndEventHandler);
$JssorSlider$.$EVT_FREEZE
function SliderFreezeEventHandler()
{
//fires on slider freeze
}
jssor_slider_instance.$On($JssorSlider$.$EVT_LOAD_END, SliderFreezeEventHandler);
$JssorSlider$.$EVT_MOUSE_ENTER
function SliderMouseEnterEventHandler()
{
//fires on mouse enter
}
jssor_slider_instance.$On($JssorSlider$.$EVT_MOUSE_ENTER, SliderMouseEnterEventHandler);
$JssorSlider$.$EVT_MOUSE_LEAVE
function SliderMouseLeaveEventHandler()
{
//fires on mouse leave
}
jssor_slider_instance.$On($JssorSlider$.$EVT_MOUSE_LEAVE, SliderMouseLeaveEventHandler);
$JssorSlider$.$EVT_POSITION_CHANGE
function SliderPositionChangeEventHandler(position, fromPosition, virtualPosition, virtualFromPosition)
{
//continuously fires while carousel sliding
//position: current position of the carousel
//fromPosition: previous position of the carousel
//virtualPosition: current virtual position of the carousel
//virtualFromPosition: previous virtual position of the carousel
}
jssor_slider_instance.$On($JssorSlider$.$EVT_POSITION_CHANGE, SliderPositionChangeEventHandler);
$JssorSlider$.$EVT_PARK
function SliderParkEventHandler(slideIndex, fromIndex)
{
//fires when carousel stopped sliding and slides park in correct position
//slideIndex: the index of current slide
//fromIndex: the index of previous slide
}
jssor_slider_instance.$On($JssorSlider$.$EVT_PARK, SliderParkEventHandler);
$JssorSlider$.$EVT_STATE_CHANGE
function(slideIndex, progress, progressBegin, idleBegin, idleEnd, progressEnd)
{
//given a slide parked, the life cycle of current slide is as below,
progressBegin --> idleBegin --> idleEnd --> progressEnd
//this event fires at any state of
'progressBegin', 'idleBegin', 'idleEnd' and 'progressEnd'
//slideIndex: the index of slide
//progress: current time in the whole process
//progressBegin: the begining of the whole process
(generally, captions start to play in)
//idleBegin: captions played in and become idle, will wait for a period
which is specified by option '$Idle'
//idleEnd: the waiting time is over, captions start to play out
//progressEnd: the whole process is completed
//tipical usage
if(progress == progressEnd)
{
//the animation of current slide is completed
}
else if(progress == idleEnd)
{
//the idle period of current slide is over
}
else if(progress == idleBegin)
{
//current slide become idle
}
else if(progress == progressBegin)
{
//the animation of current slide is at the beginning
}
else if(progress < 0)
{
//the animation of current slide is aborted,
//the progress value is negative only in this case
var realProgress = -progress - 1;
}
}
jssor_slider_instance.$On($JssorSlider$.$EVT_STATE_CHANGE, SliderStateChangeEventHandler);
$JssorSlider$.$EVT_PROGRESS_CHANGE
function SliderProgressChangeEventHandler(slideIndex, progress, progressBegin, idleBegin, idleEnd, progressEnd)
{
//this event continuously fires within the process of current slide
//tipical usage
var progressString = Math.round(progress / progressEnd * 100) + "%";
}
jssor_slider_instance.$On($JssorSlider$.$EVT_PROGRESS_CHANGE, SliderProgressChangeEventHandler);
$JssorSlider$.$EVT_SLIDESHOW_START
function SliderSlideshowStartEventHandler(slideIndex, progress, progressBegin, slideshowBegin, slideshowEnd, progressEnd)
{
//within the whole process of a slide, there maybe slideshow to run
//this event fires when slideshow begin
}
jssor_slider_instance.$On($JssorSlider$.$EVT_SLIDESHOW_START, SliderSlideshowStartEventHandler);
$JssorSlider$.$EVT_SLIDESHOW_END
function SliderSlideshowEndtEventHandler(slideIndex, progress, progressBegin, slideshowBegin, slideshowEnd, progressEnd)
{
//within the whole process of a slide, there maybe slideshow to run
//this event fires when slideshow end
}
jssor_slider_instance.$On($JssorSlider$.$EVT_SLIDESHOW_END, SliderSlideshowEndtEventHandler);