Vanilla javascript slider for all purposes.
nav
issue for autoWidth slider by setting navAsThumbnails: true
edgePadding
for fixedWidth
slider is now the same as other types of slidersAdded: autoWidth
#150
Added: fractional number support for items
/slideBy
#217
Improved: refine indexMax
for fixedWidth
and autoWidth
Improved: add a new div to hide overflowed slides
Fixed: an edgePadding calculation issue when slider has gutter
Fixed: update navCurrentIndexCached
at the right place
Fixed: touch/mouseDrag
for gallery
mode #219
Fixed: some other issues related to vpOuter
, vpInner
and more
Added: events newBreakpointStart
, newBreakpointEnd
#183
Changed: goto() now use index start from 1
Improved: use a new method to detect browser support of percentage width on both parent and child elements instead of merely check subpixel layout support #190
Fixed: an timing issue in MS Edge when do container transform
Fixed: an issue in navInit
Fixed: an index issue in goTo() for loop carousel
Fixed: a wrong event on touchmove/dragmove
Fixed: an error when localStorage access was blocked #215
Fixed: a page overlapping issue in gallery
mode when click nav
Fixed: functions getImageArray()
and getMaxSlideHeight()
Fixed: a layout issue on MS Edge browsers #190
Fixed: vpInner
in sliderInit()
Fixed: update the time of firing touchEnd/dragEnd
event
Fixed: a vertical slider height issue when images didn't finish loading
useLocalStorage
.innerWrapper
inline transition-duration
style.loop: false
, has edgePadding
set and slides are few than items
. #172getInnerWrapperStyles()
which cause the edgePadding
of fixedWidth
slider couldn't been set properly in slider initialization. #210rewind
support for gallery
mode.gallery
mode. #206getItemsMax()
#201prevButton
, nextButton
, swipeAngle
, fixedWidthViewportWidth
#194transition-duration
to stylesheetsheet
to info Objectloop: false
is available now #146 #188autoHeight: true
#180rebuild()
method to rebuild the slider after it's destroyed; isOn
property to indicate if the slider is live or destroyed.autoplay
will not restart on window resize even if autoplay: true
if it's paused by user.drag
event if it's initialized inside a display: none
parent element. #148destroy()
in conjunction with window resizing. #144 #159navAsThumbnails
now works on native nav
. #143localStorage
is null
on some versions of Chrome Mobile. #134rewind
now can go backward on the first slide. #141gallery
mode on resize. #140play
, pause
functions for autoplay
. #137var slider = tns({
autoplay: true,
…
});
document.querySelector('.stop').addEventListener('click', function () {
slider.pause();
});
startIndex
now can be defined in responsive
field. #138index
issue in gallery
mode.