Skip to content

Instantly share code, notes, and snippets.

Created October 7, 2010 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/615280 to your computer and use it in GitHub Desktop.
Save anonymous/615280 to your computer and use it in GitHub Desktop.
//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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment