View Single Post
Old 10-17-2012, 01:21 AM   PM User | #1
vorl
Regular Coder

 
Join Date: Feb 2005
Posts: 190
Thanks: 25
Thanked 0 Times in 0 Posts
vorl is an unknown quantity at this point
on submit, show Fancybox after 5 seconds

Hi again

This probably is easy but I cant see where im going wrong.

So what is supposed to happen is that onsubmit there is a 5 second wait before the fancybox function opens. The problem I have is when I try to add the setTimeout function and I bet its something easy but I cant get it to work.

Code im using is below. Anybody help me out please?

Thanks!

Code:
$(document).ready(function(){
//---
$("form").submit(function(e){

	setTimeout(function (){

		$.fancybox({
		 'href' : '#loading-wait',   
		 'width' : 650,
		 'height' : 350,
		 'autoScale' : false,
		 'transitionIn' : 'none',
		 'transitionOut' : 'none',
		 'scrolling' : 'no',		 
		 'type' : 'inline',
		 'showCloseButton' : false,
		 'hideOnOverlayClick' : false,
		 'hideOnContentClick' : false    
		 })
		 
                 return false;
	})
	
        , 5000 );

});

});
vorl is offline   Reply With Quote