...

View Full Version : looking for flash-effect



jspeybro
08-19-2004, 12:03 PM
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... :confused:

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

Willy Duitt
08-19-2004, 02:01 PM
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...



<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

jspeybro
08-20-2004, 04:15 PM
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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum