Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    May 2004
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    looking for flash-effect

    Hi, it's probably already been asked or easy to do, but I don't know what to look for exactly.
    this is what I want to do:

    when a page loads, it should have a sort of flashing effect for a short time (half a second or something). after that the actual website should apear, with a text on top of it, also during a short time. then the text should disappear and just the actual site should be viewable.

    I tried to make a script myself, but I don't know enough javascript.

    I think it should be possible to show and hide a div a few times. this div has height and width 100% and on top of everything.after that showing a div containing some text. after a short time this div will disappear too.
    but I don't know anything about timing with javascript, so...

    when this script is working, I would like to add a cookie, so that this effect only happens if the cookie doesn't exists and after the effect, sets the cookie, but that's another thing.

    any idea's?
    thanks in advance

    Johan

  • #2
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't really understand your question(s) but I just happen to have
    this flashing (blinking) script from something else I was working on today...

    Code:
    <style type="text/css">
     <!--
      .blink { background-color: blue;
               text-align: center;
               width:   150px;
               height:  40px;
               padding: 10px;
               margin:  none;
               border-style: solid;
               border-color: #000000;
               border-bottom-width: 5px;
               cursor:  pointer;
               cursor:  hand;
      }
     -->
    </style>
    <script type="text/javascript">
     <!--//
      var oldID,blinker,color=[];
      function blink(element,color1){ 
       var isID = document.getElementById,
           isIE = document.all;
    
        if((!isIE && e || event) && (!isIE && e || event).type.match(/click|load/i)){
          if(oldID && !oldID.match(element) || color.length == 0){
             color = [isID(element).currentStyle.backgroundColor,color1];
          }
    
          if(oldID && oldID.match(element)){
             isID(oldID).style.backgroundColor = color[0];
             clearTimeout(blinker);
             oldID = color = '';
             return;
          }
        }
    
        if(oldID && !oldID.match(element)){
             isID(oldID).style.backgroundColor = color[0];
             clearTimeout(blinker);
        }    oldID = theID = element;  
             isID(theID).style.backgroundColor = 
             isID(theID).style.backgroundColor.match(color[0]) ? color[1] : color[0];
             blinker = setTimeout('blink(theID,color[1])',500);
      }
     //-->
    </script>
    </head>
    
    <body onload="blink('TD2','orange')">
     <table cellpadding="0" cellspacing="0">
      <tr>
       <td id="TD1" class="blink" onclick="blink(this.id,'red')">Cell 1</td>
       <td id="TD2" class="blink" onclick="blink(this.id,'orange')">Cell 2</td>
       <td id="TD3" class="blink" onclick="blink(this.id,'yellow')">Cell 3</td>
      </tr>
     </table>
    
    <!--// EXAMPLE OF HOW TO STOP THE BLINK BLINK //-->
    <!--// BLINK BLINK CAN ALSO BE STOPPED BY RECLICKING ACTIVE ELEMENT //-->
    <a href="#" onclick="blink()">Stop Blink</a>
    .....Willy
    Last edited by Willy Duitt; 08-19-2004 at 02:18 PM.

  • #3
    New Coder
    Join Date
    May 2004
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hmm, this might be interesting. I'll take a look at it a bit more closer when I have a little more time.

    thanks for the script

    Johan


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •