Closed rmilecki closed 8 years ago
Documentation quote:
Passing false disables the animation.
However doing lightbox.load({animation: false}); doesn't work. Lightbox still uses 400ms animation.
lightbox.load({animation: false});
This is caused by the following part of code: animation: opt.animation || 400, which picks 400 number value in case of passing false.
animation: opt.animation || 400,
I believe above line should be changed to: animation: typeof opt.animation === 'number' || opt.animation === false ? opt.animation : 400,
animation: typeof opt.animation === 'number' || opt.animation === false ? opt.animation : 400,
Proposed code treats false as disabled animation, true as default animation time (400 ms) and any numeric value as custom animation time.
false
true
totally right. Thanks!
Documentation quote:
However doing
lightbox.load({animation: false});
doesn't work. Lightbox still uses 400ms animation.This is caused by the following part of code:
animation: opt.animation || 400,
which picks 400 number value in case of passing false.I believe above line should be changed to:
animation: typeof opt.animation === 'number' || opt.animation === false ? opt.animation : 400,
Proposed code treats
false
as disabled animation,true
as default animation time (400 ms) and any numeric value as custom animation time.