Closed Dupond closed 12 years ago
After all it was not that difficult to fix this issue :)
Here's what I've done :
// The focus must go to the first link of the first VISIBLE item :
$("#carousel-comments").delegate("li:first a", "focusin", function () {
$("#carousel-comments li.jcarousel-item-first a").focus();
return false;
});
// After the last link of the last visible item, the focus should go out :
$("#carousel-comments").delegate("li.jcarousel-item-last a", "keydown", function (e) {
var code = (e.keyCode ? e.keyCode : e.which);
if (code == 9) { $("#rang3 a").first().focus(); return false; }
});
Hello! Everything work's perfectly, but some problem in scrollCallback from this code:
var scrollCallback = function(event, carousel, target) { var list = carousel.list(), items = carousel.items(), size = carouselCommentsData.length, parsed = jCarousel.parseTarget(target), first = carousel.last().index() + 1, last = first + parsed.target; for (var i = first; i < last; i++) { if (i >= size) { break; } if (items.eq(i).size() > 0) { continue; } list.append(createItem(carouselCommentsData[i])); } carousel.reload(); };
Error from firebug console:
ReferenceError: jCarousel is not defined parsed = jCarousel.parseTarget(target);
In the meantime, everything was moved under the $
namespace, so it is now
$.jCarousel.parseTarget(target)
Works like a charm! Many thx!
I'd like to convert my carousels to 0.3 branch, in order to fix my focus problems, and the resize problems under Chrome, as discussed in several issues here.
Is there some kind of know limitations with this branch, compared to the 0.2.8 one ? For example :
Furthermore, I've put my config code in an external file : should I use $(document).ready() (as I used to with 0.2.8) ? For the moment, I just have the following code in my config file :
Is that fine ?
Thanx for your help, Dupond