SiteExperts.com Logo Home | Community | Developer's Paradise | Jobs
User Groups | Site Tools | Site Information | Search

Inside Technique : Cross Browser BLINK Element : Scripting Blink

Since Internet Explorer 4.0 parses the Blink tag, all we need to do is create a timer that automatically hides and shows the contents of all BLINK elements on the page. After the page is loaded, we create a timer that locates all the BLINK elements swapping their CSS visibility property. The code is as follows:

<SCRIPT>
// Before you reuse this script you may want to have your head examined
// 
// Copyright 1999 InsideDHTML.com, LLC.  

function doBlink() {
  // Blink, Blink, Blink...
  var blink = document.all.tags("BLINK")
  for (var i=0; i < blink.length; i++)
    blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : "" 
}

function startBlink() {
  // Make sure it is IE4
  if (document.all)
    setInterval("doBlink()",1000)
}
window.onload = startBlink;
</SCRIPT>

Now, we wouldn't be fair to all the blinking text fans out there if we also did not provide an even more powerful solution that takes advantage of the latest browser technologies. Once the decision to use blinking text has been made you should not have to worry about integrating your script on the page. Instead, you should just apply the behavior using Internet Explorer 5.0 behaviors.

Page 1:Cross Browser BLINK Element
Page 2:Scripting Blink
Page 3:IE5 Blink Behavior