nir9 / itemslide

JavaScript Touch Carousel Library with Zero Dependencies

Home Page:https://itemslide.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong calculation with different item size

simeonwong opened this issue · comments

When the first item with small width, slide will display strange

HTML:

<div class="itemSlider">
    <ul>
        <li style="width:299px;height:500px;background:#000;"></li>
        <li style="width:599px;height:500px;background:#F00;"></li>
        <li style="width:499px;height:500px;background:#0F0;"></li>
        <li style="width:699px;height:500px;background:#00F;"></li>
    </ul>
</div>

JS:
itemSlider.itemslide({ disable_clicktoslide:true, left_sided:true, disable_scroll:true });
result :
1455616185397

Interesting, this bug indeed looks to occur when slides have different sizes, looking into this, thanks for reporting

Thanks for reporting, was an interesting bug, the code was indeed assuming that all slides had the same width, but now it handles different widths correctly :)