jsor / jcarousel

Riding carousels with jQuery.
https://sorgalla.com/jcarousel/
MIT License
1.99k stars 734 forks source link

Autoscroll scroll even with only one item #786

Closed ghost closed 8 years ago

ghost commented 8 years ago

Hi,

I am facing an issue when using your plugin, which is amazing. When I have only one item in my banner the scroll is still scrolling, i.e. keeps transitioning between the same image.

Here is my code:

jQuery(document).ready(function ($) {
    $(".Aesa_Banner")
        .jcarousel({ wrap: 'circular'})
        .jcarouselAutoscroll({
            interval: 5000,
            target: '+=1',
            autostart: true
        });

    $('.Aesa_Banner__pagination')
        .on('jcarouselpagination:active', 'a', function () {
            $(this).addClass('active');
        })
        .on('jcarouselpagination:inactive', 'a', function () {
            $(this).removeClass('active');
        })
        .jcarouselPagination({
            perPage: 1,
            item: function(page) {
                return '<a href="#' + page + '">' + page + '</a>';
            }
        });
});
jsor commented 8 years ago

Could you setup a reproducible test case somewhere? It should not scroll when in underflow mode, maybe the image is a little bit larger as the visible area.