// Create a closure
(function(){
// Your base, I'm in it!
var originalAddClassMethod = jQuery.fn.addClass;
jQuery.fn.addClass = function(){
// Execute the original method.
var result = originalAddClassMethod.apply( this, arguments );
// trigger a custom event
jQuery(this).trigger('cssClassChanged');
// return the original result
return result;
}
})();
// document ready function
$(function(){
$(".hero-slider.hs-mb.w-slider .w-slider-dot").bind('cssClassChanged', function(){
//do stuff here
$('.hero-slider.hs-mb.w-slider .hero-slider-nav .w-slider-dot').each(function (index, value) {
if($(this).hasClass('w-active')){
id = index;
$('.dc').css("display","none");
if(id==0){ $('.dc.dc-entrepreneurs').css('display','block'); }
if(id==1){ $('.dc.dc-sb').css('display','block'); }
if(id==2){ $('.dc.dc-mb').css('display','block'); }
if(id==3){ $('.dc.dc-smb').css('display','block'); }
if(id==4){ $('.dc.dc-suite').css('display','block'); }
}
});
});
});
No comments:
Post a Comment