i wrote a custom jquery function that accept a callback but not being able to understand how call back function will execute at the calling environment when animate function execution end.
here is my custom function code
jQuery.fn.busyToggle = function (flag, marginBottom, opacity, speed, easing, callback) {
if (flag == 1) {
return this.stop(true).animate({ marginBottom: marginBottom, opacity: opacity }, { queue: false, duration: speed });
}
else {
return this.stop(true).animate({ marginBottom: marginBottom, opacity: opacity }, { queue: false, duration: speed });
}
};
this way i am calling this function
$('#BusyBox').busyToggle(flag,0,1,500);
i need to know that how to capture when animate function end from calling environment. if possible please discuss in detail. thanks
Just add your callback to the complete option of
animate