Posted in JavaScript on May 17th, 2005 Comments Off
To use this, just call CountDays() with two properly formatted date values.
<script type=”text/javascript”>
<!–
function CountDays(StartDate,EndDate)
{
var StartMS=Date.parse(new Date(StartDate));
var DateMS=Date.parse((EndDate));
return parseInt(DateMS-StartMS)/86400000;
}
var StartDate=’May 01, 2001 00:00:00′;
var EndDate=’May 17, 2001 00:00:00′;
document.write (CountDays(StartDate,EndDate));
//–>
</script>
Read Full Post »
Posted in JavaScript on May 17th, 2005 Comments Off
Flashing text is crap. Don’t do it.
This code needs a <div> to contain the text you want to flash, and is called in the ‘onLoad’ event of the <body> tag with something like <body onLoad=”Blink(’LayerName’);”>
<script type=”text/javascript”>
<!–
function Blink(BlinkID)
{
BlinkLayer = document.getElementById(BlinkID);
if (BlinkLayer.style.color==\’#880000\’ || BlinkLayer.style.color==\’rgb(136, 0, 0)\’ || BlinkLayer.style.color==\’rgb(136,0,0)\’)
BlinkLayer.style.color=\’#000088\’;
else
BlinkLayer.style.color=\’#880000\’;
setTimeout(\’Blink(\\’\’ + BlinkID + \’\\’)\’,500);
}–>
</script>
Read Full Post »