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
| (function($){
$.fn.jmenuCarousel = function(aFunction){
return this.each(function(i, item){
// list
var slideList = $(item).find('.slide_Menu_list');
// clip
var clip = slideList.parent();
// width of list
var listWidth = 0;
// catch scroll item
$(item).find('li').each(function(j, jtem){
listWidth += $(jtem).width();
if(typeof aFunction == 'function'){
$(jtem).find('a').each(function(k, ktem){
//reset a click comportement
$(ktem).unbind('click');
// add comportement
$(ktem).click(aFunction);
});
}
});
});
};
})(jQuery); |