Domanda

I am trying to implement Sorgalla jCarousel to my website, but I can't seem to get it to work, even though to my knowledge, I have done everything as instructions say.

To help myself think and to simplify the situation, I even created a fiddle with just basic functions, and even that doesn't work!

http://jsfiddle.net/b2cwv/1/

Any suggestions what might be wrong with this? It's simplified from what I have in the website, but the code is basically the same.

$(document).ready(function() {

    $(function() {
        $('.jcarousel').jcarousel({
            list: '.jcarousel-list',
            items: '.jcarousel-item',
            rtl: true,
            center: true,
            animation: 'slow'
            scroll: '+=1'
            wrap: 'both'
        });   
    });

    $('.jcarousel-prev').click(function() {
        $('.jcarousel').jcarousel('scroll', '-=1');
    });

    $('.jcarousel-next').click(function() {
        $('.jcarousel').jcarousel('scroll', '+=1');
    });
});

It simply just doesn't fire.

È stato utile?

Soluzione

Add the comma after all the configuration

animation: slow

Fix the css list width

width: 2em

check this fiddle

http://jsfiddle.net/raunakkathuria/b2cwv/2/

Its working now

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top