Search code examples
javascriptjqueryjcarousel

pass arguments to jcarousel itemLoadCallback method


How can we pass arguments to jcarousel itemLoadCallback method?

Thanks


Solution

  • You can't directly pass arguments to the itemLoadCallback as far as I can see. itemLoadCallback executes the function you give it passing in explicitly those arguments. You'd have to modify jcarousel to send additional arguments. I'd also like to understand what you're trying to achieve as maybe there is another way to achieve what you want. You could do something like the following, which should suffice from what I assume you're trying to do:

    Here is how I would do it

    jQuery('#mycarousel').jcarousel({
        itemLoadCallback: function (carousel, state) {
            //get Additional Information
            //doStuff with additional info
        }
    });