loryjs / lory

☀ Touch enabled minimalistic slider written in vanilla JavaScript.
http://loryjs.github.io/lory/
MIT License
2.28k stars 243 forks source link

initialIndex without animation #740

Closed rustam87 closed 5 years ago

rustam87 commented 6 years ago

When i use initialIndex in during init lory, i have animation to slide. How can i see slide without animation

silllli commented 6 years ago

You can turn off the initial slide animation by disabling all transitions on the lory element via CSS first and enabling them again after lory was initialized.

You could for example add a no-animations class and remove it after lory was initialized.

CSS: .no-animations * { transition: none; }

And then add in your JS (before initializing lory!): document.addEventListener('after.lory.init', function() { yourLoryElement.classList.remove('no-animations'); });

nstanard commented 5 years ago

@rustam87 Can you please create a demo/example of what you are trying to accomplish that shows the issue you are facing. I will take a look at it and provide feedback. I have not run into this issue before.