loryjs / lory

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

Add border in slide prevents slide with variable width slider #704

Closed TixieSalander closed 5 years ago

TixieSalander commented 7 years ago

Hello, I was stuck while using Lory on one of my projects: for some reason is was impossible to slide to other slide than the first one, even with swipe on mobile. I finally spotted that It was because there was css border on my slide items.

Reproduce:

  1. Create a simple instance of Lory based on the documentation
  2. Set your slider with a percentage width.
  3. Add css border on slie items (the ones with js_slide class)

I made an example on Codepen to be easy to test : https://codepen.io/theotix/pen/EwQWYm and to show you, there is the same without the border, who's working just well: https://codepen.io/theotix/pen/PJBOeG

It's not a big bug, but maybe something could be done to fix this strange case.

nstanard commented 5 years ago

Thank you for providing an example! I will take a look at this and see if I can assist in your goals.

nstanard commented 5 years ago

Here is a working example: https://codepen.io/nstanard/pen/jrwymd - If you have any more questions please feel free to ask on Stack Overflow or Gitter chat.