I’m using the jquery carousel and I have the image auto rotating here ( http://jsbin.com/unoce/2), so the issue I’m having is the content on the left is not AUTO rotating “with” the image and the arrow selection is not either. It only works when I click the content on the left and then the image on the right along with the arrow move appropriately together.
Can someone provide support so I may get the text and the arrow to “auto” rotate with the image?
This code below would only rotate the image and nothing else…
jQuery(document).ready(function() {
jQuery("#features").jcarousel({
scroll: 1,
auto:2,
wrap: 'both',
initCallback: mycarousel_initCallback,
buttonNextHTML: null,
buttonPrevHTML: null
});
});
Here’s a demo and you can edit this demo too:
http://jsbin.com/unoce/2
Thank you,
Evan
Take a look at this:
http://jsbin.com/unoce/7/edit
You’re using an old version of jQuery (1.3.2). The current is 1.4.2, so I switched it in the jsBin to use Google’s hosted version of jQuery.
This wasn’t part of the issue, but I consolidated some code. You had several calls to
$(document).ready(). This isn’t bad, but it isn’t necessary either. I consolidated the code into oneready()call.You were assigning 2 click handlers. Again, this is fine, but unnecessary. I put the code from both into the callback for the
initCallbackproperty.The
initCallbackonly gets called once, at the beginning. That is why thecurrentclass wasn’t getting updated when it would auto update.jCarousel has a lot of other callback options. One is called
itemVisibleInCallback. It actually takes an object that can take two callbacks:That is where I took care of removing and adding the
currentclass.Those callbacks can have four parameters: carousel, item, idx, state
I had to use the
idxparameter to refer to the proper item under#features-navbecause theitemparameter seemed to refer to the item being scrolled.Anyway, hope this helps.