i am using jcarousel in drupal as below:
jcarousel_add('#jcarousel',
array('vertical' => false, 'scroll' => 3, 'horizontalDirection' => $direction,
'initCallback' => 'slCarousel_initCallback')
);
now to ask the question as simple as possible: how can i slide the carousel manually?? something like
jQuery("#jcarousel").jcarousel().next();
by the way,,, when i run this script jQuery(“#jcarousel”).jcarousel().next(); in firebug i got this in the console of firebug
>>> jQuery("#jcarousel").jcarousel().next();
[]
I have tried this as well in firebug console
var carousel = jQuery("#jcarousel").data('jcarousel');
//alert (carousel);
carousel.next();
and got
>>> var carousel = jQuery("#jcarousel").data('jcarousel'); carousel.next()
TypeError: carousel is undefined
and the result of alert(carousel) was the word undefined
ok… i fixed it by creating global variable and then assigning the value of the carousel to it
var global_jc=""; function slCarousel_initCallback(carousel) { global_jc=carousel; .... }and then wherever i want to use next manually i use this