1 && _Options.$DragOrientation && _Options.$DragOrientation != _PlayOrientation)
$JssorDebug$.$Fail("Option $DragOrientation error, it should be 0 or the same of $PlayOrientation when $DisplayPieces is greater than 1.");
if (!$Jssor$.$IsNumeric(_Options.$ParkingPosition))
$JssorDebug$.$Fail("Option $ParkingPosition error, it should be a numeric value.");
if (_Options.$ParkingPosition && _Options.$DragOrientation && _Options.$DragOrientation != _PlayOrientation)
$JssorDebug$.$Fail("Option $DragOrientation error, it should be 0 or the same of $PlayOrientation when $ParkingPosition is not equal to 0.");
});
var _StyleDef;
var _SlideElmts = [];
{
var slideElmts = $Jssor$.$Children(_SlidesContainer);
$Jssor$.$Each(slideElmts, function (slideElmt) {
if (slideElmt.tagName == "DIV" && !$Jssor$.$AttributeEx(slideElmt, "u")) {
_SlideElmts.push(slideElmt);
}
});
}
$JssorDebug$.$Execute(function () {
if (_SlideElmts.length < 1) {
$JssorDebug$.$Error("Slides html code definition error, there must be at least 1 slide to initialize a slider.");
}
});
var _SlideItemCreatedCount = 0; //for debug only
var _SlideItemReleasedCount = 0; //for debug only
var _PreviousSlideIndex;
var _CurrentSlideIndex = -1;
var _TempSlideIndex;
var _PrevSlideItem;
var _CurrentSlideItem;
var _SlideCount = _SlideElmts.length;
var _SlideWidth = _Options.$SlideWidth || _SlidesContainerWidth;
var _SlideHeight = _Options.$SlideHeight || _SlidesContainerHeight;
var _SlideSpacing = _Options.$SlideSpacing;
var _StepLengthX = _SlideWidth + _SlideSpacing;
var _StepLengthY = _SlideHeight + _SlideSpacing;
var _StepLength = (_PlayOrientation & 1) ? _StepLengthX : _StepLengthY;
var _DisplayPieces = Math.min(_Options.$DisplayPieces, _SlideCount);
var _SlideshowPanel;
var _CurrentBoardIndex = 0;
var _DragOrientation;
var _DragOrientationRegistered;
var _DragInvalid;
var _HandleTouchEventOnly;
var _Navigators = [];
var _BulletNavigator;
var _ArrowNavigator;
var _ThumbnailNavigator;
var _ShowLink;
var _Frozen;
var _AutoPlay;
var _AutoPlaySteps = _Options.$AutoPlaySteps;
var _HoverToPause = _Options.$PauseOnHover;
var _AutoPlayInterval = _Options.$AutoPlayInterval;
var _SlideDuration = _Options.$SlideDuration;
var _SlideshowRunnerClass;
var _TransitionsOrder;
var _SlideshowEnabled;
var _ParkingPosition;
var _CarouselEnabled = _DisplayPieces < _SlideCount;
var _Loop = _CarouselEnabled ? _Options.$Loop : 0;
var _DragEnabled;
var _LastDragSucceded;
var _HoverStatus = 1; //0 Hovering, 1 Not hovering
//Variable Definition
var _IsSliding;
var _IsDragging;
var _LoadingTicket;
//The X position of mouse/touch when a drag start
var _DragStartMouseX = 0;
//The Y position of mouse/touch when a drag start
var _DragStartMouseY = 0;
var _DragOffsetTotal;
var _DragOffsetLastTime;
var _DragIndexAdjust;
var _Carousel;
var _Conveyor;
var _Slideshow;
var _CarouselPlayer;
var _SlideContainer = new SlideContainer();
var _ScaleRatio;
//$JssorSlider$ Constructor
{
_AutoPlay = _Options.$AutoPlay;
_SelfSlider.$Options = options;
AdjustSlidesContainerSize();
elmt["jssor-slider"] = true;
//_SlideshowPanel = CreatePanel();
//$Jssor$.$CssZIndex(elmt, $Jssor$.$CssZIndex(elmt));
//$Jssor$.$CssLeft(_SlideshowPanel, $Jssor$.$CssLeft(_SlidesContainer));
//$Jssor$.$CssZIndex(_SlidesContainer, $Jssor$.$CssZIndex(_SlidesContainer));
//$Jssor$.$CssTop(_SlideshowPanel, $Jssor$.$CssTop(_SlidesContainer));
$Jssor$.$CssZIndex(_SlidesContainer, $Jssor$.$CssZIndex(_SlidesContainer) || 0);
$Jssor$.$CssPosition(_SlidesContainer, "absolute");
_SlideshowPanel = $Jssor$.$CloneNode(_SlidesContainer);
$Jssor$.$InsertBefore($Jssor$.$ParentNode(_SlidesContainer), _SlideshowPanel, _SlidesContainer);
if (_SlideshowOptions) {
_ShowLink = _SlideshowOptions.$ShowLink;
_SlideshowRunnerClass = _SlideshowOptions.$Class;
$JssorDebug$.$Execute(function () {
if (!_SlideshowOptions.$Transitions || !_SlideshowOptions.$Transitions.length) {
$JssorDebug$.$Error("Invalid '$SlideshowOptions', no '$Transitions' specified.");
}
});
$Jssor$.$TranslateTransitions(_SlideshowOptions.$Transitions); //for old transition compatibility
_SlideshowEnabled = _DisplayPieces == 1 && _SlideCount > 1 && _SlideshowRunnerClass && (!$Jssor$.$IsBrowserIE() || $Jssor$.$BrowserVersion() >= 8);
}
_ParkingPosition = (_SlideshowEnabled || _DisplayPieces >= _SlideCount || !(_Loop & 1)) ? 0 : _Options.$ParkingPosition;
_DragEnabled = ((_DisplayPieces > 1 || _ParkingPosition) ? _PlayOrientation : -1) & _Options.$DragOrientation;
//SlideBoard
var _SlideboardElmt = _SlidesContainer;
var _SlideItems = [];
var _SlideshowRunner;
var _LinkContainer;
var _DownEvent = "mousedown";
var _MoveEvent = "mousemove";
var _UpEvent = "mouseup";
var _CancelEvent;
var _LastTimeMoveByDrag;
var _Position_OnFreeze;
var _CarouselPlaying_OnFreeze;
var _PlayToPosition_OnFreeze;
var _PositionToGoByDrag;
//SlideBoard Constructor
{
var msPrefix;
if (window.navigator.pointerEnabled || (msPrefix = window.navigator.msPointerEnabled)) {
_DownEvent = msPrefix ? "MSPointerDown" : "pointerdown";
_MoveEvent = msPrefix ? "MSPointerMove" : "pointermove";
_UpEvent = msPrefix ? "MSPointerUp" : "pointerup";
_CancelEvent = msPrefix ? "MSPointerCancel" : "pointercancel";
if (_DragEnabled) {
var touchAction = "none";
if (_DragEnabled == 1) {
touchAction = "pan-y";
}
else if (_DragEnabled == 2) {
touchAction = "pan-x";
}
$Jssor$.$Css(_SlideboardElmt, msPrefix ? "msTouchAction" : "touchAction", touchAction);
}
}
else if ("ontouchstart" in window || "createTouch" in document) {
_HandleTouchEventOnly = true;
_DownEvent = "touchstart";
_MoveEvent = "touchmove";
_UpEvent = "touchend";
_CancelEvent = "touchcancel";
}
_Slideshow = new Slideshow();
if (_SlideshowEnabled)
_SlideshowRunner = new _SlideshowRunnerClass(_SlideContainer, _SlideWidth, _SlideHeight, _SlideshowOptions, _HandleTouchEventOnly);
$Jssor$.$AppendChild(_SlideshowPanel, _Slideshow.$Wrapper);
$Jssor$.$CssOverflow(_SlidesContainer, "hidden");
//link container
{
_LinkContainer = CreatePanel();
$Jssor$.$Css(_LinkContainer, "backgroundColor", "#000");
$Jssor$.$CssOpacity(_LinkContainer, 0);
$Jssor$.$InsertBefore(_SlideboardElmt, _LinkContainer, _SlideboardElmt.firstChild);
}
for (var i = 0; i < _SlideElmts.length; i++) {
var slideElmt = _SlideElmts[i];
var slideItem = new SlideItem(slideElmt, i);
_SlideItems.push(slideItem);
}
$Jssor$.$HideElement(_LoadingContainer);
$JssorDebug$.$Execute(function () {
$Jssor$.$Attribute(_LoadingContainer, "debug-id", "loading-container");
});
_Carousel = new Carousel()
_CarouselPlayer = new CarouselPlayer(_Carousel, _Slideshow);
$JssorDebug$.$Execute(function () {
$Jssor$.$Attribute(_SlideboardElmt, "debug-id", "slide-board");
});
if (_DragEnabled) {
$Jssor$.$AddEvent(_SlidesContainer, _DownEvent, OnMouseDown);
$Jssor$.$AddEvent(document, _UpEvent, OnDragEnd);
_CancelEvent && $Jssor$.$AddEvent(document, _CancelEvent, OnDragEnd);
}
}
//SlideBoard
_HoverToPause &= (_HandleTouchEventOnly ? 10 : 5);
//Bullet Navigator
if (_BulletNavigatorContainer && _BulletNavigatorOptions) {
_BulletNavigator = new _BulletNavigatorOptions.$Class(_BulletNavigatorContainer, _BulletNavigatorOptions, OriginalWidth(), OriginalHeight());
_Navigators.push(_BulletNavigator);
}
//Arrow Navigator
if (_ArrowNavigatorOptions && _ArrowLeft && _ArrowRight) {
_ArrowNavigator = new _ArrowNavigatorOptions.$Class(_ArrowLeft, _ArrowRight, _ArrowNavigatorOptions, OriginalWidth(), OriginalHeight());
_Navigators.push(_ArrowNavigator);
}
//Thumbnail Navigator
if (_ThumbnailNavigatorContainer && _ThumbnailNavigatorOptions) {
_ThumbnailNavigatorOptions.$StartIndex = _Options.$StartIndex;
_ThumbnailNavigator = new _ThumbnailNavigatorOptions.$Class(_ThumbnailNavigatorContainer, _ThumbnailNavigatorOptions);
_Navigators.push(_ThumbnailNavigator);
}
$Jssor$.$Each(_Navigators, function (navigator) {
navigator.$Reset(_SlideCount, _SlideItems, _LoadingContainer);
navigator.$On($JssorNavigatorEvents$.$NAVIGATIONREQUEST, NavigationClickHandler);
});
Scale(OriginalWidth());
$Jssor$.$AddEvent(elmt, "mouseout", $Jssor$.$MouseOverOutFilter(MainContainerMouseLeaveEventHandler, elmt));
$Jssor$.$AddEvent(elmt, "mouseover", $Jssor$.$MouseOverOutFilter(MainContainerMouseEnterEventHandler, elmt));
ShowNavigators();
//Keyboard Navigation
if (_Options.$ArrowKeyNavigation) {
$Jssor$.$AddEvent(document, "keydown", function (e) {
if (e.keyCode == $JssorKeyCode$.$LEFT) {
//Arrow Left
PlayToOffset(-1);
}
else if (e.keyCode == $JssorKeyCode$.$RIGHT) {
//Arrow Right
PlayToOffset(1);
}
});
}
var startPosition = _Options.$StartIndex;
if (!(_Loop & 1)) {
startPosition = Math.max(0, Math.min(startPosition, _SlideCount - _DisplayPieces));
}
_CarouselPlayer.$PlayCarousel(startPosition, startPosition, 0);
}
}
//Jssor Slider
//JssorSlider.$ASSEMBLY_BOTTOM_LEFT = ASSEMBLY_BOTTOM_LEFT;
//JssorSlider.$ASSEMBLY_BOTTOM_RIGHT = ASSEMBLY_BOTTOM_RIGHT;
//JssorSlider.$ASSEMBLY_TOP_LEFT = ASSEMBLY_TOP_LEFT;
//JssorSlider.$ASSEMBLY_TOP_RIGHT = ASSEMBLY_TOP_RIGHT;
//JssorSlider.$ASSEMBLY_LEFT_TOP = ASSEMBLY_LEFT_TOP;
//JssorSlider.$ASSEMBLY_LEFT_BOTTOM = ASSEMBLY_LEFT_BOTTOM;
//JssorSlider.$ASSEMBLY_RIGHT_TOP = ASSEMBLY_RIGHT_TOP;
//JssorSlider.$ASSEMBLY_RIGHT_BOTTOM = ASSEMBLY_RIGHT_BOTTOM;
JssorSlider.$EVT_CLICK = 21;
JssorSlider.$EVT_DRAG_START = 22;
JssorSlider.$EVT_DRAG_END = 23;
JssorSlider.$EVT_SWIPE_START = 24;
JssorSlider.$EVT_SWIPE_END = 25;
JssorSlider.$EVT_LOAD_START = 26;
JssorSlider.$EVT_LOAD_END = 27;
JssorSlider.$EVT_FREEZE = 28;
JssorSlider.$EVT_POSITION_CHANGE = 202;
JssorSlider.$EVT_PARK = 203;
JssorSlider.$EVT_SLIDESHOW_START = 206;
JssorSlider.$EVT_SLIDESHOW_END = 207;
JssorSlider.$EVT_PROGRESS_CHANGE = 208;
JssorSlider.$EVT_STATE_CHANGE = 209;
JssorSlider.$EVT_ROLLBACK_START = 210;
JssorSlider.$EVT_ROLLBACK_END = 211;
window.$JssorSlider$ = $JssorSlider$ = JssorSlider;
//(function ($) {
// jQuery.fn.jssorSlider = function (options) {
// return this.each(function () {
// return $(this).data('jssorSlider') || $(this).data('jssorSlider', new JssorSlider(this, options));
// });
// };
//})(jQuery);
//window.jQuery && (jQuery.fn.jssorSlider = function (options) {
// return this.each(function () {
// return jQuery(this).data('jssorSlider') || jQuery(this).data('jssorSlider', new JssorSlider(this, options));
// });
//});
};
//$JssorBulletNavigator$
var $JssorNavigatorEvents$ = {
$NAVIGATIONREQUEST: 1,
$INDEXCHANGE: 2,
$RESET: 3
};
var $JssorBulletNavigator$ = window.$JssorBulletNavigator$ = function (elmt, options, containerWidth, containerHeight) {
var self = this;
$JssorObject$.call(self);
elmt = $Jssor$.$GetElement(elmt);
var _Count;
var _Length;
var _Width;
var _Height;
var _CurrentIndex;
var _CurrentInnerIndex = 0;
var _Options;
var _Steps;
var _Lanes;
var _SpacingX;
var _SpacingY;
var _Orientation;
var _ItemPrototype;
var _PrototypeWidth;
var _PrototypeHeight;
var _ButtonElements = [];
var _Buttons = [];
function Highlight(index) {
if (index != -1)
_Buttons[index].$Activate(index == _CurrentInnerIndex);
}
function OnNavigationRequest(index) {
self.$TriggerEvent($JssorNavigatorEvents$.$NAVIGATIONREQUEST, index * _Steps);
}
self.$Elmt = elmt;
self.$GetCurrentIndex = function () {
return _CurrentIndex;
};
self.$SetCurrentIndex = function (index) {
if (index != _CurrentIndex) {
var lastInnerIndex = _CurrentInnerIndex;
var innerIndex = Math.floor(index / _Steps);
_CurrentInnerIndex = innerIndex;
_CurrentIndex = index;
Highlight(lastInnerIndex);
Highlight(innerIndex);
//self.$TriggerEvent($JssorNavigatorEvents$.$INDEXCHANGE, index);
}
};
self.$Show = function (hide) {
$Jssor$.$ShowElement(elmt, hide);
};
var _Located;
self.$Relocate = function (force) {
if (!_Located || _Options.$Scale == false) {
if (_Options.$AutoCenter & 1) {
$Jssor$.$CssLeft(elmt, (containerWidth - _Width) / 2);
}
if (_Options.$AutoCenter & 2) {
$Jssor$.$CssTop(elmt, (containerHeight - _Height) / 2);
}
_Located = true;
}
};
var _Initialized;
self.$Reset = function (length) {
if (!_Initialized) {
_Length = length;
_Count = Math.ceil(length / _Steps);
_CurrentInnerIndex = 0;
var itemOffsetX = _PrototypeWidth + _SpacingX;
var itemOffsetY = _PrototypeHeight + _SpacingY;
var maxIndex = Math.ceil(_Count / _Lanes) - 1;
_Width = _PrototypeWidth + itemOffsetX * (!_Orientation ? maxIndex : _Lanes - 1);
_Height = _PrototypeHeight + itemOffsetY * (_Orientation ? maxIndex : _Lanes - 1);
$Jssor$.$CssWidth(elmt, _Width);
$Jssor$.$CssHeight(elmt, _Height);
//self.$Relocate(true);
for (var buttonIndex = 0; buttonIndex < _Count; buttonIndex++) {
var numberDiv = $Jssor$.$CreateSpan();
$Jssor$.$InnerText(numberDiv, buttonIndex + 1);
var div = $Jssor$.$BuildElement(_ItemPrototype, "NumberTemplate", numberDiv, true);
$Jssor$.$CssPosition(div, "absolute");
var columnIndex = buttonIndex % (maxIndex + 1);
$Jssor$.$CssLeft(div, !_Orientation ? itemOffsetX * columnIndex : buttonIndex % _Lanes * itemOffsetX);
$Jssor$.$CssTop(div, _Orientation ? itemOffsetY * columnIndex : Math.floor(buttonIndex / (maxIndex + 1)) * itemOffsetY);
$Jssor$.$AppendChild(elmt, div);
_ButtonElements[buttonIndex] = div;
if (_Options.$ActionMode & 1)
$Jssor$.$AddEvent(div, "click", $Jssor$.$CreateCallback(null, OnNavigationRequest, buttonIndex));
if (_Options.$ActionMode & 2)
$Jssor$.$AddEvent(div, "mouseover", $Jssor$.$MouseOverOutFilter($Jssor$.$CreateCallback(null, OnNavigationRequest, buttonIndex), div));
_Buttons[buttonIndex] = $Jssor$.$Buttonize(div);
}
//self.$TriggerEvent($JssorNavigatorEvents$.$RESET);
_Initialized = true;
}
};
//JssorBulletNavigator Constructor
{
self.$Options = _Options = $Jssor$.$Extend({
$SpacingX: 0,
$SpacingY: 0,
$Orientation: 1,
$ActionMode: 1
}, options);
//Sodo statement for development time intellisence only
$JssorDebug$.$Execute(function () {
_Options = $Jssor$.$Extend({
$Steps: undefined,
$Lanes: undefined
}, _Options);
});
_ItemPrototype = $Jssor$.$FindChild(elmt, "prototype");
$JssorDebug$.$Execute(function () {
if (!_ItemPrototype)
$JssorDebug$.$Fail("Navigator item prototype not defined.");
if (isNaN($Jssor$.$CssWidth(_ItemPrototype))) {
$JssorDebug$.$Fail("Width of 'navigator item prototype' not specified.");
}
if (isNaN($Jssor$.$CssHeight(_ItemPrototype))) {
$JssorDebug$.$Fail("Height of 'navigator item prototype' not specified.");
}
});
_PrototypeWidth = $Jssor$.$CssWidth(_ItemPrototype);
_PrototypeHeight = $Jssor$.$CssHeight(_ItemPrototype);
$Jssor$.$RemoveChild(elmt, _ItemPrototype);
_Steps = _Options.$Steps || 1;
_Lanes = _Options.$Lanes || 1;
_SpacingX = _Options.$SpacingX;
_SpacingY = _Options.$SpacingY;
_Orientation = _Options.$Orientation - 1;
}
};
var $JssorArrowNavigator$ = window.$JssorArrowNavigator$ = function (arrowLeft, arrowRight, options, containerWidth, containerHeight) {
var self = this;
$JssorObject$.call(self);
$JssorDebug$.$Execute(function () {
if (!arrowLeft)
$JssorDebug$.$Fail("Option '$ArrowNavigatorOptions' spepcified, but UI 'arrowleft' not defined. Define 'arrowleft' to enable direct navigation, or remove option '$ArrowNavigatorOptions' to disable direct navigation.");
if (!arrowRight)
$JssorDebug$.$Fail("Option '$ArrowNavigatorOptions' spepcified, but UI 'arrowright' not defined. Define 'arrowright' to enable direct navigation, or remove option '$ArrowNavigatorOptions' to disable direct navigation.");
if (isNaN($Jssor$.$CssWidth(arrowLeft))) {
$JssorDebug$.$Fail("Width of 'arrow left' not specified.");
}
if (isNaN($Jssor$.$CssWidth(arrowRight))) {
$JssorDebug$.$Fail("Width of 'arrow right' not specified.");
}
if (isNaN($Jssor$.$CssHeight(arrowLeft))) {
$JssorDebug$.$Fail("Height of 'arrow left' not specified.");
}
if (isNaN($Jssor$.$CssHeight(arrowRight))) {
$JssorDebug$.$Fail("Height of 'arrow right' not specified.");
}
});
var _Length;
var _CurrentIndex;
var _Options;
var _Steps;
var _ArrowWidth = $Jssor$.$CssWidth(arrowLeft);
var _ArrowHeight = $Jssor$.$CssHeight(arrowLeft);
function OnNavigationRequest(steps) {
self.$TriggerEvent($JssorNavigatorEvents$.$NAVIGATIONREQUEST, steps, true);
}
self.$GetCurrentIndex = function () {
return _CurrentIndex;
};
self.$SetCurrentIndex = function (index, virtualIndex, temp) {
if (temp) {
_CurrentIndex = virtualIndex;
}
else {
_CurrentIndex = index;
}
//self.$TriggerEvent($JssorNavigatorEvents$.$INDEXCHANGE, index);
};
self.$Show = function (hide) {
$Jssor$.$ShowElement(arrowLeft, hide);
$Jssor$.$ShowElement(arrowRight, hide);
};
var _Located;
self.$Relocate = function (force) {
if (!_Located || _Options.$Scale == false) {
if (_Options.$AutoCenter & 1) {
$Jssor$.$CssLeft(arrowLeft, (containerWidth - _ArrowWidth) / 2);
$Jssor$.$CssLeft(arrowRight, (containerWidth - _ArrowWidth) / 2);
}
if (_Options.$AutoCenter & 2) {
$Jssor$.$CssTop(arrowLeft, (containerHeight - _ArrowHeight) / 2);
$Jssor$.$CssTop(arrowRight, (containerHeight - _ArrowHeight) / 2);
}
_Located = true;
}
};
var _Initialized;
self.$Reset = function (length) {
_Length = length;
_CurrentIndex = 0;
if (!_Initialized) {
//self.$Relocate(true);
$Jssor$.$AddEvent(arrowLeft, "click", $Jssor$.$CreateCallback(null, OnNavigationRequest, -_Steps));
$Jssor$.$AddEvent(arrowRight, "click", $Jssor$.$CreateCallback(null, OnNavigationRequest, _Steps));
$Jssor$.$Buttonize(arrowLeft);
$Jssor$.$Buttonize(arrowRight);
_Initialized = true;
}
//self.$TriggerEvent($JssorNavigatorEvents$.$RESET);
};
//JssorArrowNavigator Constructor
{
self.$Options = _Options = $Jssor$.$Extend({
$Steps: 1
}, options);
_Steps = _Options.$Steps;
}
};
//for navigator to keep scrolling on mouse down
var $JssorArrowNavigatorMouseDown$ = window.$JssorArrowNavigatorMouseDown$ = function(arrowLeft, arrowRight, options, containerWidth, containerHeight) {
var self = this;
$JssorObject$.call(self);
$JssorDebug$.$Execute(function() {
if (!arrowLeft)
$JssorDebug$.$Fail("Option '$ArrowNavigatorOptions' spepcified, but UI 'arrowleft' not defined. Define 'arrowleft' to enable direct navigation, or remove option '$ArrowNavigatorOptions' to disable direct navigation.");
if (!arrowRight)
$JssorDebug$.$Fail("Option '$ArrowNavigatorOptions' spepcified, but UI 'arrowright' not defined. Define 'arrowright' to enable direct navigation, or remove option '$ArrowNavigatorOptions' to disable direct navigation.");
if (isNaN($Jssor$.$CssWidth(arrowLeft))) {
$JssorDebug$.$Fail("Width of 'arrow left' not specified.");
}
if (isNaN($Jssor$.$CssWidth(arrowRight))) {
$JssorDebug$.$Fail("Width of 'arrow right' not specified.");
}
if (isNaN($Jssor$.$CssHeight(arrowLeft))) {
$JssorDebug$.$Fail("Height of 'arrow left' not specified.");
}
if (isNaN($Jssor$.$CssHeight(arrowRight))) {
$JssorDebug$.$Fail("Height of 'arrow right' not specified.");
}
});
var _Length;
var _CurrentIndex;
var _Options;
var _Steps;
var _ArrowWidth = $Jssor$.$CssWidth(arrowLeft);
var _ArrowHeight = $Jssor$.$CssHeight(arrowLeft);
var _moveInterval;
function OnNavigationRequest(steps) {
self.$TriggerEvent($JssorNavigatorEvents$.$NAVIGATIONREQUEST, steps, true);
_moveInterval = setInterval(function() {
self.$TriggerEvent($JssorNavigatorEvents$.$NAVIGATIONREQUEST, steps, true);
}, 100);
}
function OnNavigationRequestOut(steps) {
clearInterval(_moveInterval);
}
self.$GetCurrentIndex = function() {
return _CurrentIndex;
};
self.$SetCurrentIndex = function(index, virtualIndex, temp) {
if (temp) {
_CurrentIndex = virtualIndex;
}
else {
_CurrentIndex = index;
}
//self.$TriggerEvent($JssorNavigatorEvents$.$INDEXCHANGE, index);
};
self.$Show = function(hide) {
$Jssor$.$ShowElement(arrowLeft, hide);
$Jssor$.$ShowElement(arrowRight, hide);
};
var _Located;
self.$Relocate = function(force) {
if (!_Located || _Options.$Scale == false) {
if (_Options.$AutoCenter & 1) {
$Jssor$.$CssLeft(arrowLeft, (containerWidth - _ArrowWidth) / 2);
$Jssor$.$CssLeft(arrowRight, (containerWidth - _ArrowWidth) / 2);
}
if (_Options.$AutoCenter & 2) {
$Jssor$.$CssTop(arrowLeft, (containerHeight - _ArrowHeight) / 2);
$Jssor$.$CssTop(arrowRight, (containerHeight - _ArrowHeight) / 2);
}
_Located = true;
}
};
var _Initialized;
self.$Reset = function(length) {
_Length = length;
_CurrentIndex = 0;
if (!_Initialized) {
//self.$Relocate(true);
$Jssor$.$AddEvent(arrowLeft, "mousedown", $Jssor$.$CreateCallback(null, OnNavigationRequest, -_Steps));
$Jssor$.$AddEvent(arrowLeft, "mouseup", $Jssor$.$CreateCallback(null, OnNavigationRequestOut, -_Steps));
$Jssor$.$AddEvent(arrowRight, "mousedown", $Jssor$.$CreateCallback(null, OnNavigationRequest, _Steps));
$Jssor$.$AddEvent(arrowRight, "mouseup", $Jssor$.$CreateCallback(null, OnNavigationRequestOut, _Steps));
$Jssor$.$Buttonize(arrowLeft);
$Jssor$.$Buttonize(arrowRight);
_Initialized = true;
}
//self.$TriggerEvent($JssorNavigatorEvents$.$RESET);
};
//JssorArrowNavigator Constructor
{
self.$Options = _Options = $Jssor$.$Extend({
$Steps: 1
}, options);
_Steps = _Options.$Steps;
}
};
//$JssorThumbnailNavigator$
var $JssorThumbnailNavigator$ = window.$JssorThumbnailNavigator$ = function (elmt, options) {
var _Self = this;
var _Length;
var _Count;
var _CurrentIndex;
var _Options;
var _NavigationItems = [];
var _Width;
var _Height;
var _Lanes;
var _SpacingX;
var _SpacingY;
var _PrototypeWidth;
var _PrototypeHeight;
var _DisplayPieces;
var _Slider;
var _CurrentMouseOverIndex = -1;
var _SlidesContainer;
var _ThumbnailPrototype;
$JssorObject$.call(_Self);
elmt = $Jssor$.$GetElement(elmt);
function NavigationItem(item, index) {
var self = this;
var _Wrapper;
var _Button;
var _Thumbnail;
function Highlight(mouseStatus) {
_Button.$Activate(_CurrentIndex == index);
}
function OnNavigationRequest(event) {
if (!_Slider.$LastDragSucceded()) {
var tail = _Lanes - index % _Lanes;
var slideVirtualIndex = _Slider.$GetVirtualIndex((index + tail) / _Lanes - 1);
var itemVirtualIndex = slideVirtualIndex * _Lanes + _Lanes - tail;
_Self.$TriggerEvent($JssorNavigatorEvents$.$NAVIGATIONREQUEST, itemVirtualIndex);
}
//$JssorDebug$.$Log("navigation request");
}
$JssorDebug$.$Execute(function () {
self.$Wrapper = undefined;
});
self.$Index = index;
self.$Highlight = Highlight;
//NavigationItem Constructor
{
_Thumbnail = item.$Thumb || item.$Image || $Jssor$.$CreateDiv();
self.$Wrapper = _Wrapper = $Jssor$.$BuildElement(_ThumbnailPrototype, "ThumbnailTemplate", _Thumbnail, true);
_Button = $Jssor$.$Buttonize(_Wrapper);
if (_Options.$ActionMode & 1)
$Jssor$.$AddEvent(_Wrapper, "click", OnNavigationRequest);
if (_Options.$ActionMode & 2)
$Jssor$.$AddEvent(_Wrapper, "mouseover", $Jssor$.$MouseOverOutFilter(OnNavigationRequest, _Wrapper));
}
}
_Self.$GetCurrentIndex = function () {
return _CurrentIndex;
};
_Self.$SetCurrentIndex = function (index, virtualIndex, temp) {
var oldIndex = _CurrentIndex;
_CurrentIndex = index;
if (oldIndex != -1)
_NavigationItems[oldIndex].$Highlight();
_NavigationItems[index].$Highlight();
if (!temp) {
_Slider.$PlayTo(_Slider.$GetVirtualIndex(Math.floor(virtualIndex / _Lanes)));
}
};
_Self.$Show = function (hide) {
$Jssor$.$ShowElement(elmt, hide);
};
_Self.$Relocate = $Jssor$.$EmptyFunction;
var _Initialized;
_Self.$Reset = function (length, items, loadingContainer) {
if (!_Initialized) {
_Length = length;
_Count = Math.ceil(_Length / _Lanes);
_CurrentIndex = -1;
_DisplayPieces = Math.min(_DisplayPieces, items.length);
var horizontal = _Options.$Orientation & 1;
var slideWidth = _PrototypeWidth + (_PrototypeWidth + _SpacingX) * (_Lanes - 1) * (1 - horizontal);
var slideHeight = _PrototypeHeight + (_PrototypeHeight + _SpacingY) * (_Lanes - 1) * horizontal;
var slidesContainerWidth = slideWidth + (slideWidth + _SpacingX) * (_DisplayPieces - 1) * horizontal;
var slidesContainerHeight = slideHeight + (slideHeight + _SpacingY) * (_DisplayPieces - 1) * (1 - horizontal);
$Jssor$.$CssPosition(_SlidesContainer, "absolute");
$Jssor$.$CssOverflow(_SlidesContainer, "hidden");
if (_Options.$AutoCenter & 1) {
$Jssor$.$CssLeft(_SlidesContainer, (_Width - slidesContainerWidth) / 2);
}
if (_Options.$AutoCenter & 2) {
$Jssor$.$CssTop(_SlidesContainer, (_Height - slidesContainerHeight) / 2);
}
//$JssorDebug$.$Execute(function () {
// if (!_Options.$AutoCenter) {
// var slidesContainerTop = $Jssor$.$CssTop(_SlidesContainer);
// var slidesContainerLeft = $Jssor$.$CssLeft(_SlidesContainer);
// if (isNaN(slidesContainerTop)) {
// $JssorDebug$.$Fail("Position 'top' wrong specification of thumbnail navigator slides container (
...
), \r\nwhen option $ThumbnailNavigatorOptions.$AutoCenter set to 0, it should be specified in pixel (like
)");
// }
// if (isNaN(slidesContainerLeft)) {
// $JssorDebug$.$Fail("Position 'left' wrong specification of thumbnail navigator slides container (
...
), \r\nwhen option $ThumbnailNavigatorOptions.$AutoCenter set to 0, it should be specified in pixel (like
)");
// }
// }
//});
$Jssor$.$CssWidth(_SlidesContainer, slidesContainerWidth);
$Jssor$.$CssHeight(_SlidesContainer, slidesContainerHeight);
var slideItemElmts = [];
$Jssor$.$Each(items, function (item, index) {
var navigationItem = new NavigationItem(item, index);
var navigationItemWrapper = navigationItem.$Wrapper;
var columnIndex = Math.floor(index / _Lanes);
var laneIndex = index % _Lanes;
$Jssor$.$CssLeft(navigationItemWrapper, (_PrototypeWidth + _SpacingX) * laneIndex * (1 - horizontal));
$Jssor$.$CssTop(navigationItemWrapper, (_PrototypeHeight + _SpacingY) * laneIndex * horizontal);
if (!slideItemElmts[columnIndex]) {
slideItemElmts[columnIndex] = $Jssor$.$CreateDiv();
$Jssor$.$AppendChild(_SlidesContainer, slideItemElmts[columnIndex]);
}
$Jssor$.$AppendChild(slideItemElmts[columnIndex], navigationItemWrapper);
_NavigationItems.push(navigationItem);
});
var thumbnailSliderOptions = $Jssor$.$Extend({
$AutoPlay: false,
$NaviQuitDrag: false,
$SlideWidth: slideWidth,
$SlideHeight: slideHeight,
$SlideSpacing: _SpacingX * horizontal + _SpacingY * (1 - horizontal),
$MinDragOffsetToSlide: 12,
$SlideDuration: 200,
$PauseOnHover: 1,
$PlayOrientation: _Options.$Orientation,
$DragOrientation: _Options.$DisableDrag ? 0 : _Options.$Orientation
}, _Options);
_Slider = new $JssorSlider$(elmt, thumbnailSliderOptions);
_Initialized = true;
}
//_Self.$TriggerEvent($JssorNavigatorEvents$.$RESET);
};
//JssorThumbnailNavigator Constructor
{
_Self.$Options = _Options = $Jssor$.$Extend({
$SpacingX: 3,
$SpacingY: 3,
$DisplayPieces: 1,
$Orientation: 1,
$AutoCenter: 3,
$ActionMode: 1
}, options);
//Sodo statement for development time intellisence only
$JssorDebug$.$Execute(function () {
_Options = $Jssor$.$Extend({
$Lanes: undefined,
$Width: undefined,
$Height: undefined
}, _Options);
});
_Width = $Jssor$.$CssWidth(elmt);
_Height = $Jssor$.$CssHeight(elmt);
$JssorDebug$.$Execute(function () {
if (!_Width)
$JssorDebug$.$Fail("width of 'thumbnavigator' container not specified.");
if (!_Height)
$JssorDebug$.$Fail("height of 'thumbnavigator' container not specified.");
});
_SlidesContainer = $Jssor$.$FindChild(elmt, "slides", true);
_ThumbnailPrototype = $Jssor$.$FindChild(_SlidesContainer, "prototype");
$JssorDebug$.$Execute(function () {
if (!_ThumbnailPrototype)
$JssorDebug$.$Fail("prototype of 'thumbnavigator' not defined.");
});
_PrototypeWidth = $Jssor$.$CssWidth(_ThumbnailPrototype);
_PrototypeHeight = $Jssor$.$CssHeight(_ThumbnailPrototype);
$Jssor$.$RemoveChild(_SlidesContainer, _ThumbnailPrototype);
_Lanes = _Options.$Lanes || 1;
_SpacingX = _Options.$SpacingX;
_SpacingY = _Options.$SpacingY;
_DisplayPieces = _Options.$DisplayPieces;
}
};
//$JssorCaptionSliderBase$
function $JssorCaptionSliderBase$() {
$JssorAnimator$.call(this, 0, 0);
this.$Revert = $Jssor$.$EmptyFunction;
}
var $JssorCaptionSlider$ = window.$JssorCaptionSlider$ = function (container, captionSlideOptions, playIn) {
$JssorDebug$.$Execute(function () {
if (!captionSlideOptions.$CaptionTransitions) {
$JssorDebug$.$Error("'$CaptionSliderOptions' option error, '$CaptionSliderOptions.$CaptionTransitions' not specified.");
}
//else if (!$Jssor$.$IsArray(captionSlideOptions.$CaptionTransitions)) {
// $JssorDebug$.$Error("'$CaptionSliderOptions' option error, '$CaptionSliderOptions.$CaptionTransitions' is not an array.");
//}
});
var _Self = this;
var _ImmediateOutCaptionHanger;
var _PlayMode = playIn ? captionSlideOptions.$PlayInMode : captionSlideOptions.$PlayOutMode;
var _CaptionTransitions = captionSlideOptions.$CaptionTransitions;
var _CaptionTuningFetcher = { $Transition: "t", $Delay: "d", $Duration: "du", x: "x", y: "y", $Rotate: "r", $Zoom: "z", $Opacity: "f", $BeginTime: "b" };
var _CaptionTuningTransfer = {
$Default: function (value, tuningValue) {
if (!isNaN(tuningValue.$Value))
value = tuningValue.$Value;
else
value *= tuningValue.$Percent;
return value;
},
$Opacity: function (value, tuningValue) {
return this.$Default(value - 1, tuningValue);
}
};
_CaptionTuningTransfer.$Zoom = _CaptionTuningTransfer.$Opacity;
$JssorAnimator$.call(_Self, 0, 0);
function GetCaptionItems(element, level) {
var itemsToPlay = [];
var lastTransitionName;
var namedTransitions = [];
var namedTransitionOrders = [];
//$JssorDebug$.$Execute(function () {
// var debugInfoElement = $Jssor$.$GetElement("debugInfo");
// if (debugInfoElement && playIn) {
// var text = $Jssor.$InnerHtml(debugInfoElement) + "
";
// $Jssor$.$InnerHtml(debugInfoElement, text);
// }
//});
function FetchRawTransition(captionElmt, index) {
var rawTransition = {};
$Jssor$.$Each(_CaptionTuningFetcher, function (fetchAttribute, fetchProperty) {
var attributeValue = $Jssor$.$AttributeEx(captionElmt, fetchAttribute + (index || ""));
if (attributeValue) {
var propertyValue = {};
if (fetchAttribute == "t") {
//if (($Jssor$.$IsBrowserChrome() || $Jssor$.$IsBrowserSafari() || $Jssor$.$IsBrowserFireFox()) && attributeValue == "*") {
// attributeValue = Math.floor(Math.random() * captionSlideOptions.$CaptionTransitions.length);
// $Jssor$.$Attribute(captionElmt, fetchAttribute + (index || ""), attributeValue);
//}
propertyValue.$Value = attributeValue;
}
else if (attributeValue.indexOf("%") + 1)
propertyValue.$Percent = $Jssor$.$ParseFloat(attributeValue) / 100;
else
propertyValue.$Value = $Jssor$.$ParseFloat(attributeValue);
rawTransition[fetchProperty] = propertyValue;
}
});
return rawTransition;
}
function GetRandomTransition() {
return _CaptionTransitions[Math.floor(Math.random() * _CaptionTransitions.length)];
}
function EvaluateCaptionTransition(transitionName) {
var transition;
if (transitionName == "*") {
transition = GetRandomTransition();
}
else if (transitionName) {
//indexed transition allowed, just the same as named transition
var tempTransition = _CaptionTransitions[$Jssor$.$ParseInt(transitionName)] || _CaptionTransitions[transitionName];
if ($Jssor$.$IsArray(tempTransition)) {
if (transitionName != lastTransitionName) {
lastTransitionName = transitionName;
namedTransitionOrders[transitionName] = 0;
namedTransitions[transitionName] = tempTransition[Math.floor(Math.random() * tempTransition.length)];
}
else {
namedTransitionOrders[transitionName]++;
}
tempTransition = namedTransitions[transitionName];
if ($Jssor$.$IsArray(tempTransition)) {
tempTransition = tempTransition.length && tempTransition[namedTransitionOrders[transitionName] % tempTransition.length];
if ($Jssor$.$IsArray(tempTransition)) {
//got transition from array level 3, random for all captions
tempTransition = tempTransition[Math.floor(Math.random() * tempTransition.length)];
}
//else {
// //got transition from array level 2, in sequence for all adjacent captions with same name specified
// transition = tempTransition;
//}
}
//else {
// //got transition from array level 1, random but same for all adjacent captions with same name specified
// transition = tempTransition;
//}
}
//else {
// //got transition directly from a simple transition object
// transition = tempTransition;
//}
transition = tempTransition;
if ($Jssor$.$IsString(transition))
transition = EvaluateCaptionTransition(transition);
}
return transition;
}
var captionElmts = $Jssor$.$Children(element);
$Jssor$.$Each(captionElmts, function (captionElmt, i) {
var transitionsWithTuning = [];
transitionsWithTuning.$Elmt = captionElmt;
var isCaption = $Jssor$.$AttributeEx(captionElmt, "u") == "caption";
$Jssor$.$Each(playIn ? [0, 3] : [2], function (j, k) {
if (isCaption) {
var transition;
var rawTransition;
if (j != 2 || !$Jssor$.$AttributeEx(captionElmt, "t3")) {
rawTransition = FetchRawTransition(captionElmt, j);
if (j == 2 && !rawTransition.$Transition) {
rawTransition.$Delay = rawTransition.$Delay || { $Value: 0 };
rawTransition = $Jssor$.$Extend(FetchRawTransition(captionElmt, 0), rawTransition);
}
}
if (rawTransition && rawTransition.$Transition) {
transition = EvaluateCaptionTransition(rawTransition.$Transition.$Value);
if (transition) {
//var transitionWithTuning = $Jssor$.$Extend({ $Delay: 0, $ScaleHorizontal: 1, $ScaleVertical: 1 }, transition);
var transitionWithTuning = $Jssor$.$Extend({ $Delay: 0 }, transition);
$Jssor$.$Each(rawTransition, function (rawPropertyValue, propertyName) {
var tuningPropertyValue = (_CaptionTuningTransfer[propertyName] || _CaptionTuningTransfer.$Default).apply(_CaptionTuningTransfer, [transitionWithTuning[propertyName], rawTransition[propertyName]]);
if (!isNaN(tuningPropertyValue))
transitionWithTuning[propertyName] = tuningPropertyValue;
});
if (!k) {
if (rawTransition.$BeginTime)
transitionWithTuning.$BeginTime = rawTransition.$BeginTime.$Value || 0;
else if ((_PlayMode) & 2)
transitionWithTuning.$BeginTime = 0;
}
}
}
transitionsWithTuning.push(transitionWithTuning);
}
if ((level % 2) && !k) {
//transitionsWithTuning.$Children = GetCaptionItems(captionElmt, lastTransitionName, [].concat(namedTransitions), [].concat(namedTransitionOrders), level + 1);
transitionsWithTuning.$Children = GetCaptionItems(captionElmt, level + 1);
}
});
itemsToPlay.push(transitionsWithTuning);
});
return itemsToPlay;
}
function CreateAnimator(item, transition, immediateOut) {
var animatorOptions = {
$Easing: transition.$Easing,
$Round: transition.$Round,
$During: transition.$During,
$Reverse: playIn && !immediateOut,
$Optimize: true
};
$JssorDebug$.$Execute(function () {
animatorOptions.$CaptionAnimator = true;
});
var captionItem = item;
var captionParent = $Jssor$.$ParentNode(item);
var captionItemWidth = $Jssor$.$CssWidth(captionItem);
var captionItemHeight = $Jssor$.$CssHeight(captionItem);
var captionParentWidth = $Jssor$.$CssWidth(captionParent);
var captionParentHeight = $Jssor$.$CssHeight(captionParent);
var toStyles = {};
var fromStyles = {};
var scaleClip = transition.$ScaleClip || 1;
//Opacity
if (transition.$Opacity) {
toStyles.$Opacity = 2 - transition.$Opacity;
}
animatorOptions.$OriginalWidth = captionItemWidth;
animatorOptions.$OriginalHeight = captionItemHeight;
//Transform
if (transition.$Zoom || transition.$Rotate) {
toStyles.$Zoom = transition.$Zoom ? transition.$Zoom - 1 : 1;
if ($Jssor$.$IsBrowserIe9Earlier() || $Jssor$.$IsBrowserOpera())
toStyles.$Zoom = Math.min(toStyles.$Zoom, 2);
fromStyles.$Zoom = 1;
var rotate = transition.$Rotate || 0;
toStyles.$Rotate = rotate * 360;
fromStyles.$Rotate = 0;
}
//Clip
else if (transition.$Clip) {
var fromStyleClip = { $Top: 0, $Right: captionItemWidth, $Bottom: captionItemHeight, $Left: 0 };
var toStyleClip = $Jssor$.$Extend({}, fromStyleClip);
var blockOffset = toStyleClip.$Offset = {};
var topBenchmark = transition.$Clip & 4;
var bottomBenchmark = transition.$Clip & 8;
var leftBenchmark = transition.$Clip & 1;
var rightBenchmark = transition.$Clip & 2;
if (topBenchmark && bottomBenchmark) {
blockOffset.$Top = captionItemHeight / 2 * scaleClip;
blockOffset.$Bottom = -blockOffset.$Top;
}
else if (topBenchmark)
blockOffset.$Bottom = -captionItemHeight * scaleClip;
else if (bottomBenchmark)
blockOffset.$Top = captionItemHeight * scaleClip;
if (leftBenchmark && rightBenchmark) {
blockOffset.$Left = captionItemWidth / 2 * scaleClip;
blockOffset.$Right = -blockOffset.$Left;
}
else if (leftBenchmark)
blockOffset.$Right = -captionItemWidth * scaleClip;
else if (rightBenchmark)
blockOffset.$Left = captionItemWidth * scaleClip;
animatorOptions.$Move = transition.$Move;
toStyles.$Clip = toStyleClip;
fromStyles.$Clip = fromStyleClip;
}
//Fly
{
var toLeft = 0;
var toTop = 0;
if (transition.x)
toLeft -= captionParentWidth * transition.x;
if (transition.y)
toTop -= captionParentHeight * transition.y;
if (toLeft || toTop || animatorOptions.$Move) {
toStyles.$Left = toLeft + $Jssor$.$CssLeft(captionItem);
toStyles.$Top = toTop + $Jssor$.$CssTop(captionItem);
}
}
//duration
var duration = transition.$Duration;
fromStyles = $Jssor$.$Extend(fromStyles, $Jssor$.$GetStyles(captionItem, toStyles));
animatorOptions.$Setter = $Jssor$.$StyleSetterEx();
return new $JssorAnimator$(transition.$Delay, duration, animatorOptions, captionItem, fromStyles, toStyles);
}
function CreateAnimators(streamLineLength, captionItems) {
$Jssor$.$Each(captionItems, function (captionItem, i) {
$JssorDebug$.$Execute(function () {
if (captionItem.length) {
var top = $Jssor$.$CssTop(captionItem.$Elmt);
var left = $Jssor$.$CssLeft(captionItem.$Elmt);
var width = $Jssor$.$CssWidth(captionItem.$Elmt);
var height = $Jssor$.$CssHeight(captionItem.$Elmt);
var error = null;
if (isNaN(top))
error = "Style 'top' for caption not specified. Please always specify caption like 'position: absolute; top: ...px; left: ...px; width: ...px; height: ...px;'.";
else if (isNaN(left))
error = "Style 'left' not specified. Please always specify caption like 'position: absolute; top: ...px; left: ...px; width: ...px; height: ...px;'.";
else if (isNaN(width))
error = "Style 'width' not specified. Please always specify caption like 'position: absolute; top: ...px; left: ...px; width: ...px; height: ...px;'.";
else if (isNaN(height))
error = "Style 'height' not specified. Please always specify caption like 'position: absolute; top: ...px; left: ...px; width: ...px; height: ...px;'.";
if (error)
$JssorDebug$.$Error("Caption " + (i + 1) + " definition error, \r\n" + error + "\r\n" + captionItem.$Elmt.outerHTML);
}
});
var animator;
var captionElmt = captionItem.$Elmt;
var transition = captionItem[0];
var transition3 = captionItem[1];
if (transition) {
animator = CreateAnimator(captionElmt, transition);
streamLineLength = animator.$Locate(transition.$BeginTime == undefined ? streamLineLength : transition.$BeginTime, 1);
}
streamLineLength = CreateAnimators(streamLineLength, captionItem.$Children);
if (transition3) {
var animator3 = CreateAnimator(captionElmt, transition3, 1);
animator3.$Locate(streamLineLength, 1);
_Self.$Combine(animator3);
_ImmediateOutCaptionHanger.$Combine(animator3);
}
if (animator)
_Self.$Combine(animator);
});
return streamLineLength;
}
_Self.$Revert = function () {
_Self.$GoToPosition(_Self.$GetPosition_OuterEnd() * (playIn || 0));
_ImmediateOutCaptionHanger.$GoToBegin();
};
//Constructor
{
_ImmediateOutCaptionHanger = new $JssorAnimator$(0, 0);
//var streamLineLength = 0;
//var captionItems = GetCaptionItems(container, null, [], [], 1);
CreateAnimators(0, _PlayMode ? GetCaptionItems(container, 1) : []);
}
};
//Event Table
//$EVT_CLICK = 21; function(slideIndex[, event])
//$EVT_DRAG_START = 22; function(position[, virtualPosition, event])
//$EVT_DRAG_END = 23; function(position, startPosition[, virtualPosition, virtualStartPosition, event])
//$EVT_SWIPE_START = 24; function(position[, virtualPosition])
//$EVT_SWIPE_END = 25; function(position[, virtualPosition])
//$EVT_LOAD_START = 26; function(slideIndex)
//$EVT_LOAD_END = 27; function(slideIndex)
//$EVT_POSITION_CHANGE = 202; function(position, fromPosition[, virtualPosition, virtualFromPosition])
//$EVT_PARK = 203; function(slideIndex, fromIndex)
//$EVT_PROGRESS_CHANGE = 208; function(slideIndex, progress[, progressBegin, idleBegin, idleEnd, progressEnd])
//$EVT_STATE_CHANGE = 209; function(slideIndex, progress[, progressBegin, idleBegin, idleEnd, progressEnd])
//$EVT_ROLLBACK_START = 210; function(slideIndex, progress[, progressBegin, idleBegin, idleEnd, progressEnd])
//$EVT_ROLLBACK_END = 211; function(slideIndex, progress[, progressBegin, idleBegin, idleEnd, progressEnd])
//$EVT_SLIDESHOW_START = 206; function(slideIndex[, progressBegin, slideshowBegin, slideshowEnd, progressEnd])
//$EVT_SLIDESHOW_END = 207; function(slideIndex[, progressBegin, slideshowBegin, slideshowEnd, progressEnd])
//http://www.jssor.com/development/reference-api.html