ganlanyuan / tiny-slider

Vanilla javascript slider for all purposes.
MIT License
5.26k stars 785 forks source link

Incorrect calculation of the slide width when using properties 'fixedWidth' and 'gutter'. #812

Open daryavolakh opened 1 year ago

daryavolakh commented 1 year ago

Issue description: The values of these properties are concatenated. For example, with a 'width: 400' and 'gutter: 96' in the inspector I see the width of the slider equals to 40096px not the 400px.

Screenshot from 2023-01-11 15-52-45 )

Demo link/slider setting:
let benefitsSlider = tns({ container: '.benefitsslider', speed: 300, items: 1, slideBy: 1, fixedWidth: '400', gutter: '96', mouseDrag: true, swipeAngle: false, controls: true, controlsContainer: '.benefitsslider-nav', prevButton: '.benefitsslider-previous', nextButton: '.benefitsslider-next', nav: false, });

Tiny-slider version: 2.9.4 Browser name && version: Google Chrome 107.0.5304.110 OS name && version: Ubuntu 20.04.2 LTS