Created
October 7, 2010 15:29
-
-
Save anonymous/615280 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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