contao-components / swipe

JavaScript touch slider with additional dot menu
5 stars 2 forks source link

Bugfix: Multiple timeouts triggered on global css changes #5

Closed bohnmedia closed 5 years ago

bohnmedia commented 5 years ago

I am building a website with functions for better accessibility. One of these functions changes the global font-size. I noticed, that this also shortened the delay of the slider interval dramaticly.

You can reproduce the issue on the contao demopage. Add another font-size to the body-tag with developer tools. Removing and adding it several times increases this effect.

https://demo.contao.org/

image

The problem is, that global changes on the webpage can cause an additional transition inside the slider. Every "transitionEnd"-Event calls the function "begin" which starts a new timeout.

The begin function got modified to make sure, that a timeout never get triggered multiple times.

leofeyer commented 5 years ago

Thank you @bohnmedia.

leofeyer commented 5 years ago

I have released version 2.1.2.