How to set delay between custom scripts

Discussion in 'jQuery' started by Nimsrules, Sep 24, 2012.

  1. #1
    Hello there fellow programmers, I need some quick help from you guys. I've been working over a couple of jQuery scripts written in a single 'scripts.js' file and want them to fire sequentially after a specific delay. I know the delay() function exists but don't know how to incorporate it between these two. Kindly guide me over this issue. All the help is gladly appreciated. Thank you!

    
    
    $(document).ready(function() {    
    
    
        //Logo and Text Move In
        $('.logo-only').stop().animate({
            'right': '18%'
            }, {duration: 'slow', queue: false}).fadeIn('slow');
        
        $('.text-only').stop().animate({
            'left': '0%'
            }, {duration: 'slow', queue: false}).fadeIn('slow');
        
        
        // Instantiate jTicker     
        $("#ticker").ticker({
            cursorList:  " ",
            rate:        30,
            delay:       10000
        }).trigger("play").trigger("stop");        
        
    }); //DOM
    
    
    Code (markup):
    I wish to set a delay between the above two scripts as in the first one should fire up after 2 seconds of page load and the second one after 2 seconds of the first script's been fired.
     
    Nimsrules, Sep 24, 2012 IP