The slideSpeed || speed check prevented the slide speed to be set to 0 when calling slide().
Similarly, the options.speed || 300 assignment prevented options.speed to be 0 in the initializer (which, granted, may not make for the most useful slider, but still).
Checking against undefined ensures 0 isn't confused with an unset speed value and allows for a truly immediate transition whenever needed.
I've also added an optional speed parameter to prev() and next() -- which is forwarded to the internal call to slide().
The
slideSpeed || speed
check prevented the slide speed to be set to0
when callingslide()
.Similarly, the
options.speed || 300
assignment preventedoptions.speed
to be0
in the initializer (which, granted, may not make for the most useful slider, but still).Checking against
undefined
ensures0
isn't confused with an unset speed value and allows for a truly immediate transition whenever needed.I've also added an optional
speed
parameter to prev() and next() -- which is forwarded to the internal call toslide()
.Let me know what you think!