Closed (works as designed)
Project:
jCarousel
Version:
7.x-2.3-alpha2
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
5 Apr 2011 at 08:31 UTC
Updated:
7 Apr 2011 at 08:48 UTC
i try to control a carousel with additional links on a page.
i'm aware of #1058028: Add guard-class and prevent JS error when using certain jCarousel options
tried already a lot to access the object, and this seems to work
for (var key in Drupal.settings.jcarousel.carousels) {
// only got one carousel - so the it will loop once .. ;)
var options = Drupal.settings.jcarousel.carousels[key];
$(options.selector).jcarousel(options).scroll(jCindex); //is supposed but doesn't work ..
$(options.selector).data('jcarousel').scroll(jCindex); // works a half & data() is not really cross-browser ..
}
but ends up in strange behavior when i click the next/prev buttons in the carousel ...
tried also to bind click events in the initCallback, but this method is never called,
probably related to #1058028: Add guard-class and prevent JS error when using certain jCarousel options
any suggestions / directions .. ?
thx
Comments
Comment #1
quicksketchThis is a question about how to use the library more than support request about how to use the module. I suggest reading the library documentation at http://sorgalla.com/projects/jcarousel/
Commands are typically executed with something like this:
$(options.selector).jcarousel('scroll', jCindex);.Comment #2
ytsurkbelieve me - i looked a lot there .., and tried even more .., somehow got blind ..
you're absolutely right; this belongs to the jCarousel functionality -
thanks for opening my eyes anyway,
exactly what i needed and it works - cross browser :D
my solution now is, as suggested:
make shure to:
parseInt resolved strange scrolling behavoir.
interesting read (give true as second argument to the scroll method if used directly)