Closed atomgiant closed 13 years ago
I've given the carousel a much needed update so much of it's core functionality has been rewritten. This means the widget factory's disable and enable methods are now supported and consequently it'll no longer error when the carousel is empty.
There are some notable changes with this update meaning the continuous extension is now working however the noOfRows option has been dropped and the touch extension isn't working with the new code just yet.
You can take a look at the latest here: http://www.richardscarrott.co.uk/assets/javascript/jquery/ui-carousel/demo/
Cheers, Rich
We have an empty carousel list that we dynamically add elements to. We add the elements and then call refresh() so jquery ui carousel can refresh all of its internal data. However, this always fails if the carousel had no elements in the _getPos function call with this error:
this.elements.items.eq(this.itemIndex).position() is null
This is because the itemIndex is set to a negative value.
I was able to fix this by changing this line to remove the leading else so the itemIndex will always be set to 0 if it is negative:
https://github.com/richardscarrott/jquery-ui-carousel/blob/master/js/jquery.ui.carousel.js#L522
Could you make this change in the core jquery.ui.carousel?
Thanks, Tom