i have a page that uses jquery to trigger an ajax request when
changing a text field in a form :
$("#kaEmail").change(function() {
$.fancybox.showActivity();
$.ajax({
type : "POST",
cache : false,
url : "checkEmail.php",
data : $(this).serializeArray(),
success : function(data) {
$.fancybox(data);
}
});
the data returned with the php file 'checkEmail.php' is shown in a
fancybox that can be closed by clicking on it.
what i need is to close it automaticly after 2 seconds
i found a tutorial online where the following is suggested :
$('a.fancydialog').fancybox({
callbackOnShow: function () {
setTimeout ('$.fn.fancybox.close ()', 2000);
}
});
i think i understand what the above means but i don't know where and
how i have to implement the 'callbackOnShow' in the jquery - ajax part
i'm now working with?
thanks for everyone willing to show me the light :)
Marco
$.ajax({
type: "POST",
cache: false,
url:"checkEmail.php",
data: $(this).serializeArray(),
success: function(data) {
$.fancybox(data,{
'onComplete': function(){
setTimeout( function() {$.fancybox.close(); },10000);
} // onComplete
}); //fancybox
} // success
}); // ajax
the 'callbackOnShow' option is for ver 1.2.x
seemed i had the correct pieces to the puzzle just didn't know how to
put it together
thanks again
gr
Marco