SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Guru team1504's Avatar
    Join Date
    May 2010
    Location
    Okemos, Michigan, USA
    Posts
    732
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    fadeIn after a minute passes in jQuery

    Hi guys,
    I was hoping someone could help me write some jQuery that runs a fadeIn after a minute passes after the script has loaded.

    I know how to write it without the time waiting....

    Code HTML4Strict:
    <!doctype HTML>
    <html lang="en">
    <head>
    <meta charset="utf-8">
    <title>Fading with jQuery></title>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js">
    <script type="text/javascript">
    $(document).ready(function() {
        ('.hidden').fadeIn();     
    });
    </script>
    </head>
    <body>
    <p class="shown"> While you are reading this text you will see some more fade in underneath</p>
    <br/>
    <p class="hidden">I have just faded in!</p>
    </body>
    </html>

    Is there something like $(document.wait(60s, function() {
    /*......jQuery here */


    Thanks in advance for any help, I really appreciate it

    Regards,
    Team 1054

  2. #2
    Barefoot on the Moon! silver trophy Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,615
    Mentioned
    56 Post(s)
    Tagged
    1 Thread(s)
    You can try the setTimeout() javascript function:

    http://www.elated.com/articles/javas...d-setinterval/
    Visit The Blog | Follow On Twitter
    301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
    Can be hosted on and utilize your own domain

  3. #3
    SitePoint Guru team1504's Avatar
    Join Date
    May 2010
    Location
    Okemos, Michigan, USA
    Posts
    732
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thank you that helps. In my experience, mixing jQuery and Javascript can result in some unreliable results however so far it seems to work.

  4. #4
    Barefoot on the Moon! silver trophy Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,615
    Mentioned
    56 Post(s)
    Tagged
    1 Thread(s)
    jQuery *is* javascript...
    Visit The Blog | Follow On Twitter
    301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
    Can be hosted on and utilize your own domain

  5. #5
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2006
    Location
    Augusta, Georgia, United States
    Posts
    4,182
    Mentioned
    16 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by team1504
    In my experience, mixing jQuery and Javascript can result in some unreliable results however so far it seems to work.
    One of my favorite new quotes.
    The only code I hate more than my own is everyone else's.

  6. #6
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by oddz View Post
    One of my favorite new quotes.
    One of mine is that ham is to hamster as java is to javascript.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  7. #7
    Under Construction silver trophybronze trophy AussieJohn's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    776
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by oddz View Post
    one of my favorite new quotes.
    +1
    var details = {
    . . web: "afterlight.com.au",
    . . photos: "jvdl.id.au",
    . . psa: "usethelatestversion.com"
    }


Tags for this Thread

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
  •