Javascript timer

Discussion in 'FaceBook' started by Sprouts, Apr 12, 2010.

  1. Sprouts

    Sprouts Regular Member

    Joined:
    Mar 20, 2010
    Messages:
    464
    Likes Received:
    326
    I want to uncover something after a certain period of time in Static FBML.

    So after 10 seconds something appears. Does anyone know how to do this or what it's called as I tried javascript timers using the search and google but thats not it?

    I want to show my step 2 of my fbml code.

    Thanks in advance.
     
    Last edited: Apr 12, 2010
  2. plouyd

    plouyd Regular Member

    Joined:
    Feb 26, 2008
    Messages:
    473
    Likes Received:
    359
    Location:
    ;=-
    Code:
    <script type='text/javascript'>
    function showit() {
      document.getElementById('errordiv').setStyle('display', 'block');
    }
    function go() {
     setTimeout(showit, 2000);
    }
    </script>
    
    <div id='errordiv' style='display:none;'>Reload?</div>
    <a href='#' onclick='go(); return false;'>go</a>
    source: http://forum.developers.facebook.com/viewtopic.php?pid=194791

    that?
     
  3. Sprouts

    Sprouts Regular Member

    Joined:
    Mar 20, 2010
    Messages:
    464
    Likes Received:
    326
    Yep, that's it.

    Thanks alot.