SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Guru
    Join Date
    Jun 2009
    Posts
    815
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    jQuery doTimeout plugin -- can't cancel timeout..

    http://mayacove.com/jq/test.html
    timeout: 4 secs after pg load pop alert

    clicking "cancel" does not cancel timeout, alert appears anyway..

    here
    http://benalman.com/code/projects/jq...es/delay-poll/
    and here
    http://benalman.com/code/projects/jq...imeout-js.html

    it says this is how you cancel timeouts w/this plugin...

    would appreciate some help..

    thank you..

  2. #2
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Location
    Melbourne, AU
    Posts
    2,191
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    The reason why is because your not preventing the default action of the anchor link, simply change your click event to the below and it should work fine.

    Code:
    $('a').click(function(e) {
        e.preventDefault();
        $.doTimeout('to');
    });

  3. #3
    SitePoint Guru
    Join Date
    Jun 2009
    Posts
    815
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    yes, thank you.. what a jerk.. I realized this last night after posting..

    however: it's not working in my real situation.. code:

    Code:
    
     
    $.doTimeout('TOinit', 500, function() {
    	$('#hall').fadeIn(800);
    
    	$.doTimeout(900, function() {  
    		$('#exc').show();
    
    		$.doTimeout(1000, function() { 
    			$('#skip_intro').show();
    			
    				$.doTimeout('zoom', 500, function() { 
    					zoomIt();
    					
    					$.doTimeout(4000, function() { 
    						$('#intro').fadeOut(1000, function() {
    							
    						$.doTimeout('TOgray', 700, function() { 
    							$('#wrapper_gray').fadeIn(2000);
    							$('#wrapper_gray img,#wrapper_gray a').fadeIn(2000);
    							$('#nav_wrapper').slideDown(2000);
    							$('#nav a').removeClass('activeSlide');
    					
    							$.doTimeout(6000, function() { 
    								$('#wrapper_gray').fadeOut(2000);
    								$('#wrapper_gray img,#wrapper_gray a').fadeOut(2000);
    								
    								$.doTimeout(2000, function() { 
    									$('#wrapper_panels').fadeIn(2000)
    									$('#content_top').slideDown(2000);
    									$('#wrapper_panels').cycle('resume');
    									
    								});
    							});
    							
    						});
    						
    					});
    					
    				});
    				
    
    			});
    
    		});
    
    	});
    
    });
    		
    		
    	//	************ intro ***********
    	
    	$('a#skip_intro').click(function(e) {
    		e.preventDefault();
    		$.doTimeout('TOgray');  //***  NOT GETTING CANCELLED *****
    		$('#wrapper_panels,#content_top,#intro').css('display','none');
    		$('#wrapper_gray,#wrapper_gray img,#wrapper_gray a,#nav_wrapper,#footer').css('display','block');
    		$('#nav a').removeClass('activeSlide');
    	});

    If I do $.doTimeout('TOinit'); instead to stop TO from the beginning, it also doesn't work...

    thank you..


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •