FLASHING LINKS

Some links are more important than others on your page...with this script, they will be noticed more as well. Use it to give any link(s) on your page a flashing trait, with independently controlled options for each link. Ah, the power of DHTML!

 » This script was made possible by: Dynamic Drive !

EXAMPLE
Example Flash Link 0
Example Flash Link 1
CODE (s)

==========================================================

Step 1: Insert the below validation code into the <head> of your page:

<script language="JavaScript1.2" type="text/javascript">

/***********************************************
* Flashing Link Script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var flashlinks=new Array()

function changelinkcolor(){
for (i=0; i< flashlinks.length; i++){
var flashtype=document.getElementById? flashlinks[i].getAttribute("flashtype")*1 : flashlinks[i].flashtype*1
var flashcolor=document.getElementById? flashlinks[i].getAttribute("flashcolor") : flashlinks[i].flashcolor
if (flashtype==0){
if (flashlinks[i].style.color!=flashcolor)
flashlinks[i].style.color=flashcolor
else
flashlinks[i].style.color=''
}
else if (flashtype==1){
if (flashlinks[i].style.backgroundColor!=flashcolor)
flashlinks[i].style.backgroundColor=flashcolor
else
flashlinks[i].style.backgroundColor=''
}
}
}

function init(){
var i=0
if (document.all){
while (eval("document.all.flashlink"+i)!=null){
flashlinks[i]= eval("document.all.flashlink"+i)
i++
}
}
else if (document.getElementById){
while (document.getElementById("flashlink"+i)!=null){
flashlinks[i]= document.getElementById("flashlink"+i)
i++
}
}
setInterval("changelinkcolor()", 1000)
}

if (window.addEventListener)
window.addEventListener("load", init, false)
else if (window.attachEvent)
window.attachEvent("onload", init)
else if (document.all)
window.onload=init

</script>

 

==========================================================

Step 2: The script operates by extending all links on your page with three optional attributes, which you apply to the specific link you wish to flash. Here are the attributes:

id="flashlinkID"

Enables flashing on the link. Replace "ID" with an integer starting from 0 and onwards, depending on the number of flashing links you have.
flashtype=? Sets the type of flash. Set to 0 for flashing on link text, 1 for flashing on link's background
flashcolor=? Sets the color of the flash. Input color name or hex value.

All three attributes should appear concurrently in the flashing link. For example:

<a href="test.htm" id="flashlink0" flashtype=0 flashcolor="green">Example 1</a>

<a href="test.htm" id="flashlink1" flashtype=1 flashcolor="lime">Example 2</a>

==========================================================

As shown above, to apply the effect to multiple links on the page, increment the ID attribute of each link from "flashlink0" to "flashlink1" etc, depending on the number of flashing links.

==========================================================

MAIN
Hosted by www.Geocities.ws