public
anonymous / gist:615280
Created

  • Download Gist
gistfile1.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
//after default and windowLoaded
var idc = 0;
 
==============================================
 
$.jcarousel = function(e, o) {
this.options = $.extend({}, defaults, o || {});
 
this.locked = false;
 
this.container = null;
this.clip = null;
this.list = null;
this.buttonNext = null;
this.buttonPrev = null;
 
//PAUL - 2010/10/05 - Adding a "unique" id to carousel to avoid conflict for nested jcarousels.
this.uniqid = idc++;
[...]
 
===============================================
 
format: function(e, i) {
var e = $(e), split = e.get(0).className.split(' ');
for (var j = 0; j < split.length; j++) {
if (split[j].indexOf('jcarousel-') != -1) {
e.removeClass(split[j]);
}
}
//Adding uniqid
e.addClass(this.className('jcarousel-item')).addClass(this.className('jcarousel-'+this.uniqid+'-item-' + i)).css({
'float': (this.options.rtl ? 'right' : 'left'),
'list-style': 'none'
}).attr('jcarouselindex', i);
return e;
}
 
===============================================
 
get: function(i) {
//PAUL - 2010/10/05 - Adding uniq
return $('.jcarousel-'+this.uniqid+'-item-' + i, this.list);
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.