Hi, below, I am creating a slider. I am passing the sliding method to the click handler, but such method doesn't fire when I call it. Do you have any idea why?
Thank you
this.sliding = function(e) {
that.slide_width = $(that.article).width();
that.slide_number = $(that.article).size();
that.max_pos = that.slide_width * (that.slide_number - 1);
that.left_pos = $(that.inner).position().left;
if ($(this).hasClass('article-previous') && that.left_pos < 0) {
$(that.inner).css({
'left': '+=' + that.slide_width + 'px'
});
}
if ($(this).hasClass('article-next') && -that.left_pos < that.max_pos) {
$(that.inner).css({
'left': '-=' + that.slide_width + 'px'
});
that.animateSkills();
}
};
element.find('.article-previous, .article-next').off('click').on('click', { slidingAction : this.sliding}, function(e){
e.stopImmediatePropagation;
e.data.slidingAction; // doesn't fire!
});