Hi i have a AjaxComplete function in a js file that fires several clicks for different buttons, but all refered to the same selector.
I need a different ajaxComplete function for every click function, is this possible?
jQuery(document).ready(function(){
var number = 1;
///////////////////////////////////////////////////
/* The button to see the single portfolio items */
jQuery(document).on('click','.cover a, .prev_mimo, .next_mimo',function (coverclick){
coverclick.preventDefault();
coverclick.stopPropagation();
coverclick.stopImmediatePropagation();
number ++;
/* Get the link */
var coverlink = jQuery(this).attr('href');
jQuery('.loadmask').show();
jQuery('.loadmask-msg').show();
jQuery('.upperdiv').animate({height : 'hide', opacity : 'hide', easing: 'EaseOutBounce'},'slow', function(){ jQuery('.upperdiv').html('');});
jQuery('.upperdiv').load(coverlink+' .loading_div');
return false;
});
jQuery('.upperdiv').ajaxComplete(function() {
var slideClass = 'all_project_images' + number;
var dentroClass = '.' + slideClass;
jQuery('html,body').stop().animate({
scrollTop: jQuery(this).offset().top},
'slow');
jQuery('.post_nav_portfolio').show();
jQuery('.slideshow ul').removeClass().addClass(slideClass);
jQuery(dentroClass).stop(false,true).responsiveSlides({
auto: true,
nav: true,
speed: 500});
jQuery('.upperdiv').animate({height : 'show', opacity : 'show', easing: 'EaseInBounce'},'slow');
jQuery('.loadmask').hide();
jQuery('.loadmask-msg').hide();
jQuery('.cover').hover(function(){
jQuery(this).children('.mimo_portfolio_image').stop().animate({opacity : 0.5},'fast');
}, function(){
jQuery(this).children('.mimo_portfolio_image').stop().animate({opacity : 1},'fast');
});
jQuery("a[rel^='prettyPhoto']").prettyPhoto();
jQuery('.slideshow').hover(function(){
jQuery(this).children('.rslides_nav').show('slow');
}, function(){
jQuery(this).children('.rslides_nav').hide('slow');
});
console.log(dentroClass);
});
});