Forum Moderators: open

Message Too Old, No Replies

Javascript Help

flashing text

         

Vermont

8:35 pm on Nov 11, 2003 (gmt 0)

10+ Year Member



Hi,

My javascripting abilities are minimal. I am in need of a script that will flash a message a few times on a web page and then disappear.

For example, the words "Your Edits Have Been Saved" flashes on and off in the color red for 5-seconds and then no longer appears.

Any idea's?

Thank you in advance.

Ron

shiji

8:32 am on Nov 12, 2003 (gmt 0)

10+ Year Member



you can use this if a simple popup window is enough which will flash on ur screen if u pres a button..like if u have edited something and pressses the edit button.
in this program the popup flashes 3 times

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

var singlemessages='Your edits have been saved'
var mspeed=0;
function popupWin() {
setTimeout('windowProp()',mspeed); // delay in seconds
}

function windowProp()
{
newWindow = window.open('','newWin','width=300,height=150,screenX=150,screenY=250');
newWindow.document.write('<html><head></head><body BGCOLOR="#ffaa00"><center>'+singlemessages+'</center></body></html>')

setTimeout('closeWin(newWindow)', 1000);// delay 1 seconds before closing
}
function closeWin(newWindow) {
newWindow.close();
mspeed++;
if(mspeed <3)
popupWin();
}

</SCRIPT>

</HEAD>

<BODY >

here you can create ur body....then after making changes..if one presses the below button u can c a popup..

<input type=submit value="Edit" onClick="popupWin()">

birdbrain

8:11 pm on Nov 12, 2003 (gmt 0)



Hi there Vermont,

here for your amusement is....
The Blinking Red Text

<html>
<head>
<title>Blinking Text Message</title>

<style type="text/css">
<!--
span#blink
{
position:absolute;
top:100px;
left:200px;
font-family:arial;
font-size:24px;
color:#ff0000;
}
//-->
</style>

<script type="text/javascript">
<!--
function blinkit()
{
intrvl=0;
for(nTimes=0;nTimes<2;nTimes++)
{
intrvl += 400;
setTimeout("document.getElementById('blink').style.color='#ffffff';",intrvl);
intrvl += 400;
setTimeout("document.getElementById('blink').style.color='#ff0000';",intrvl);
intrvl += 400;
setTimeout("document.getElementById('blink').style.color='#ffffff';",intrvl);
intrvl += 400;
setTimeout("document.getElementById('blink').style.color='#ff0000';",intrvl);
intrvl += 400;
setTimeout("document.getElementById('blink').style.color='#ffffff';",intrvl);
intrvl += 400;
setTimeout("document.getElementById('blink').style.color='#ff0000';",intrvl);
intrvl += 400;
setTimeout("document.getElementById('blink').style.color='#ffffff';",intrvl);
}
}
//-->
</script>
</head>
<body onload="blinkit();">

<span id="blink">Your Edits Have Been Saved</span>

</body>
</html>

Now you see it...now you don't.

birdbrain

shiji

6:56 am on Nov 13, 2003 (gmt 0)

10+ Year Member



hello...
ya..what he said works fine..but only thing is u r just changing the color..so do it acc to ur back ground color.

also it doesn't brings any pop-up windows..it is displayed on the screen itself...