Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 30th, 2012  |  syntax: None  |  size: 1.09 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. javascript, html5 simulate video game HUD effect
  2. <li><a href="#target" id="about">About</a></li>
  3.        
  4. <div id="overlay">
  5. <a href="#" class="btn" id="close">X</a>
  6.     <h3>Overlay</h3>
  7.     Fusce commodo congue ante, quis venenatis nibh blandit ut. Aenean felis est, dictum eget venenatis ac,vestibulum vel urna. Quisque felis metus, vehicula et semper quis, fermentum a dolor.  
  8.     </div>
  9.        
  10. $("#target").click(function() {
  11.     //alert("Handler for .click() called.");
  12.  
  13.     // set interval
  14.      var timeCount=0;
  15.     setInterval(function() {
  16.  
  17.  
  18.         if(timeCount == 1){
  19.         //alert("timeCount"+ timeCount);
  20.           $('#overlay').toggle();
  21.         }
  22.         if(timeCount == 2){
  23.         //alert("timeCount"+ timeCount);
  24.           $('#overlay').toggle();
  25.         }
  26.         if(timeCount == 3){
  27.         //alert("timeCount"+ timeCount);
  28.           $("#overlay").fadeIn("slow");
  29.         }
  30.         if(timeCount == 4){
  31.           //abortTimer();
  32.         }
  33.         timeCount++;
  34.       }, 50);
  35.       });
  36.        
  37. if( timeCount < 4) $("#overlay").toggle();
  38. else {
  39.     $("#overlay").fadeIn("slow");
  40.     clearInterval(timer);
  41. }