Tutorial :want to delay closing of fancybox window



Question:

I want to automatically close a fancybox iframe, but I want to give it a delay.

$(document).ready(function() {   parent.$.fancybox.close();  });  

The code above will automatically close the window successfully, but I want to add a delay, so they may read the message the page displays before it auto closes for them.


Solution:1

You can use setTimeout:

setTimeout("parent.$.fancybox.close()", 1000);  


Solution:2

If you are using jquery 1.4 try the delay() function:

parent.$.fancybox.delay(2000).close();


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »