SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2008
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    JQuery - Set an interval

    Hello!

    I'm real new to jQuery and I was wondering if someone could help me on this.

    Is there an easy way to run one bit of animation PAUSE then run another?

    I have written the following but Id like a pause in between.

    Code:
    $(function() {
        $('h1.white').animate({"top" : "0px"}, 1000, function(){
            $('h1.grey').animate({"top" : "150px"}, 1000)
    	});
    });
    Many thanks

  2. #2
    SitePoint Member
    Join Date
    Feb 2009
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code JavaScript:
    $(function() {
        $('h1.white').animate({"top" : "0px"}, 1000).animate({opacity: 1.0}, 3000, function(){
            $('h1.grey').animate({"top" : "150px"}, 1000)
    	});
    });

    That might not work but you get the idea. the .animate({opacity: 1.0}, 3000) part will set the opacity to 1.0 over 3 seconds but since it is already an opacity of 1.0 it just sits there. Then it would fire your next animation.


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
  •