jsor / jcarousel

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

Autoscroll Plugin not working #736

Closed devock closed 9 years ago

devock commented 9 years ago

Hello.

I'm usign jCarousel 0.3.1 with AutoScroll Plugin but this one doesn't working.

My code is

var jcarousel = $('.jcarousel-skin-news');

    jcarousel
        .on('jcarousel:reload jcarousel:create', function () {
            var width = jcarousel.innerWidth();

            jcarousel.jcarousel('items').css('width', width + 'px');
        })
        .jcarousel({
            wrap: 'circular',
            vertical: true
        })
        .jcarouselAutoscroll({
            interval: 3000,
            target: '+=1',
            autostart: true
        });

Into my <head> I have included the core file and the plugin file but the autoscroll doesn't working.

Can you help me please ?

jsor commented 9 years ago

Did you wrapped the code in $( document ).ready()?

devock commented 9 years ago

Yes.

jCarousel working, only the auto scroll doesn't working.

The original HTML code is

<div class="jcarousel-wrapper wrapper-news">
    <ul class="jcarousel-skin-news">
        <li>
            Content 
        </li>
        <li>
            Content
        </li>
    </ul>
</div>

And after the execution of javascript :

<div class="jcarousel-wrapper wrapper-news">
    <ul class="jcarousel-skin-news" data-jcarousel="true" data-jcarouselautoscroll="true">
        <li style="left: 0px; top: -11.328125px;">
            Content
        </li>
        <li>
            Content
        </li>
    </ul>
</div>
jsor commented 9 years ago

Can you please setup a reproducible test case on jsfiddle or similar?

devock commented 9 years ago

J'espère que je n'ai rien oublié : http://jsfiddle.net/n5Lp7qwx/

jsor commented 9 years ago

I don't speak french, but i updated your jsfiddle ;) http://jsfiddle.net/n5Lp7qwx/1/

devock commented 9 years ago

It's working ! Thank you !