Domanda

Using: http://sorgalla.com/projects/jcarousel/

I'm using arrows for next / previous buttons on this jCarousel. When I'm instantiating the jcarousel object, i'm giving it callbacks for these buttons so i can update the footer below it of what current pictures you're looking at. Unfortunately, this callback is only being called 3 times out of the 6 page scrolls i make. I have 24 images, scrolling 3 at a time. It updates the first click, then skips the next 5, and works on the very last click when i reach 24 out of 24 images. Any ideas?

Here's my code:

var that = this;
$('#posters').jcarousel({
    visible: 3,
    scroll: 3,
    initCallback:function(carousel) {
      that.carousel_initCallback(carousel,that);
    },
    buttonNextCallback:this.updateCurrentCarouselCount,
    buttonPrevCallback:this.updateCurrentCarouselCount,
    setupCallback:this.updateCurrentCarouselCount
});

In my previous and next callbacks I'm doing a console log to let me know when it gets fired, this is not getting fired everytime. only the initial scroll away from picture 1, and when i scroll and land on the last page.

Thanks for any help!

È stato utile?

Soluzione

You should have a

function updateCurrentCarouselCount(){
}

in your script.

And no need for this,

    buttonNextCallback: updateCurrentCarouselCount,
    buttonPrevCallback: updateCurrentCarouselCount,
    setupCallback: updateCurrentCarouselCount

will do the job for you.

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