Extension version: 2.17
Date: 2016-12-31
Dependencies: jQuery 1.6+; jquery.mousewheel.js (optionally for mousewheel scrolling); jquery.axZm.js (supposed to be used with AJAX-ZOOM);
License: AJAX-ZOOM license - http://www.ajax-zoom.com/index.php?cid=download#heading_4
About: this thumb slider plugin can be used optionally / complementary to several AJAX-ZOOM implementations. It is not required to use it. In the AJAX-ZOOM examples where this slider is implemented it can be easily replaced by any other thumb slider.
Why an other thumb slider: for external usage ("around AJAX-ZOOM on several AJAX-ZOOM example pages") we have previously used "jCarousel". Howver the former major jCarousel version has been developed around 2006 and it seemed to have had it glorious days in the past. The current, newly released jCarousel did not fulfill our expectations. Some alternatives found on the web either. Compared to AJAX-ZOOM a "thumb slider" looked like couple lines of code so we have decided to write our own plugin to use with AJAX-ZOOM. From the perspective of a coder / designer axZmThumbSlider is quite easy to implement, can be configured over javascript / CSS, is responsive and has generally needed API / options available. It can also be used as "content scroller" (not just thumbs), but this functionality is not well elaborated yet. Our plan is also to replace internal AJAX-ZOOM vertical, horizontal and inner galleries with this thumbs slider which will be the case in AJAX-ZOOM Ver. 4.3.1+
$(selector).axZmThumbSlider(options);
Option | Default | Description |
---|---|---|
orientation | 'horizontal' | Orientation value, horizontal or vertical |
multicolumn | false | If orientation is vertical enable multiple columns with thumbs |
smoothMove | 12 | Smoothness of the scrolling |
pressScrollSpeed | 6 | Max speed of movement while pressing on the buttons |
pressScrollSnap | false | Snap to thumb after pressing on the buttons |
pressScrollTime | 250 | Time ms if it is not clicked to start continuous stepless scroll |
contentMode | false | Simple content scroller instead of thumbs (experimantal) |
circularClickMode | false | Pressing on next, prev buttons will result into scrolling to next el and click on it instantly. It will however not result into visual endless loop, instead the fokus will be turned to first thumb when last is reached |
liImgAsBack | true | Images insude li tags (thumbs) will be removed and put as background of the li element |
randomize | false | Randomize order of thumbs on load, see also API methods for randomizing |
firstThumb | 1 | Thumb to show at first |
firstThumbPos | 'middle' | Default position within the slider (if possible), possible values: first, middle, last |
firstThumbTriggerClick | false | Trigger click on firstThumb |
firstThumbHighlight | false | Highlight firstThumb if firstThumbTriggerClick is not enabled |
posOnClick | 'middle' | Scroll the thumb to some position within the slider, possible values: false, 'first', 'middle', 'last' |
scrollBy | 'auto -1' |
|
mouseWheelScrollBy | '20%' | Use moousewheel for scrolling, requires Brandon Aaron's mousewheel.js; integer - number thumbs; string - px or % value, e.g. '50px' or '20%' |
debugNumbers | false | Adds numbers to the thumbs, css .axZmThumbSlider div.debugNumbers |
mouseFlowMode | false | Slider position upon mouse position on the slider |
mouseFlowMargin | 25 | Margin from left/right or top/bottom where mouse position for mouseFlowMode is not captured |
thumbLiStyle | {} | Quickly overwrite thumb style (e.g. width and height) without changing css file or write inline styles |
thumbImgStyle | {} | Can be applied when "liImgAsBack" option is disabled |
thumbLiSubClass | {mousehover: 'mousehover', selected: 'selected', first: 'first', last: 'last'} | Array like object representing thumb subclasses; you can disable by setting a value to false |
ulClass | 'axZmThumbSlider' | Main class prefix for ul element |
wrapClass | 'axZmThumbSlider_wrap' | Wrap class thumbs |
contentClass | 'axZmThumbSlider_content' | Wrap class for contentMode |
contentStyle | {} | Ver. 1.3+ Wrap style for contentMode |
wrapStyle | {} | Quickly override styles for the wraper |
outerWrapPosition | 'absolute' | Ver. 1.3+ If parent conainer has padding, setting this value to 'relative' will preserve it |
centerNoScroll | true | Center thumbnails in the slider when there is nothing to scroll |
btn | true | Enable buttons instantly |
btnOver | false | 1.3+ Button is put over thumbs |
btnHidden | false | 1.3+ Hide button if it is disabled |
btnClass | 'axZmThumbSlider_button' | Main class prefix for buttons |
btnMargin | null | Distance from button to scroll area; this margin can be also set in CSS |
btnBwdStyle | null | Quickly override css values of backword button instead of changing class |
btnFwdStyle | null | Quickly override css values of forward button instead of changing class |
btnLeftText | '«' | Text for backword button (horizontal orientation) |
btnRightText | '»' | Text for forward button (horizontal orientation) |
btnBwdObj | null | External backword button jQuery element |
btnFwdObj | null | External forward button jQuery element |
scrollbar | false | Enable / disable scrollbar |
scrollBarIndicator | false | If true no actions will be attached to track or scrollbar |
scrollbarMinDim | 20 | Min bar width for horizontal / height for vertical slider |
scrollbarMaxDim | null | Max bar width for horizontal / height for vertical slider |
scrollbarClass | 'axZmThumbSlider_scrollbar' | Scrollbar class |
scrollbarMargin | null | Distance which shrinks the length of the scrollbar, can be set with css as well |
scrollbarOffset | null | Offset of the scrollbar, can be set with css as well |
scrollbarStyle | {} | Quickly overwrite position of the scrollbar |
scrollbarContainerStyle | {} | Quickly set the margins of slider to fit buttons |
scrollbarBarStyle | {} | Quickly set bar style (color, height, margin) |
scrollbarTrackStyle | {} | Quickly set slidebar track style (color, height/width, margin) |
scrollbarOpacity | 0.85 | Opacity while doing something |
scrollbarIdleOpacity | 0.35 | Opacity in idle state |
scrollbarIdleTimeout | 350 | If scrollbarIdleOpacity is not set to 1, apply it after this ms value |
scrollBarIdleFadeoutT | 200 | Fadeout time of the scrollbar |
scrollBarMouseShowBindTo | 'both' | Bind mouseenter opacity handle functions to scrollbar itself or container, possible values: 'scrollBar', 'container', 'both' or false |
accVelocity | 45 | Acceleration velocity for touch devices |
touchOpt | {smoothMove: 12, pressScrollSpeed: 6} | Override any options for touch devices, e.g. touchOpt: {btn: false, scrollBarIndicator: true, scrollbarIdleOpacity: 0} |
Usage same as options; let us know if you need other callbacks.
Callback / Option | Default | Description |
---|---|---|
onPull | null | Function to execute after reached end or beginning of the slider, e.g. make a call to add other thumbs (see methods below) |
holdPullPx | 50 | Min pixel to pull in either direction to trigger onPull |
holdPullTime | 750 | Min time to pull in either direction to trigger onPull |
onInit | null | Callback when plugin is created |
$(selector).axZmThumbSlider(method, [arguments]); e.g. $('#slider1').axZmThumbSlider('scrollBy', '50px');
Method | Description | Arguments |
---|---|---|
stop | Stop initialized plugin | - |
run | Run initialized plugin | - |
destroy | Reward element to initial state | - |
rebuild | Destroy and rebuild plugin | - |
scrollBy | Scroll by a specified amount of pixels or prc | String, px or % value, e.g. '20px' or '50%' |
scrollTo | Scroll to specified thumb or position |
is same as $('#slider1').axZmThumbSlider('scrollTo', 7); |
appendContent | Append content if in contentMode |
|
prependContent | Prepend content if in contentMode |
|
removeAllThumbs | Remove all thumbs |
|
removeThumb | Remove thumb |
|
appendThumb | Append thumb |
|
prependThumb | Prepend Thumb |
|
insertThumbAfter | Insert Thumb after some other thumb |
|
insertThumbBefore | Insert Thumb before some other thumb |
|
changeThumbSize | Dynamically change size of the thumbnails |
|
unselect | Remove "selected" class from all thumbs | - |
select | Select specified thumb |
|
getNumberThumbs | Returns number of currently loaded thumbs | - |
isThumb | Returns n - (thumb number) from passed argument; |
|
getVisibleThumb | Returns number of thumb which is visible first |
|
randomize | Shuffle thumbs within loader element | - |
getUlEll | Returns scrolling content jQuery element (ul or div in contentMode) | - |
sortMap | Reorder thumbs in the slider upon data attribute value |
|
sortByData | Sort thumbnails by some data value |
|
triggerClick | Trigger click on an thumbnail |
|