1.将下面的代码复制到 </body> 前
<script language="JavaScript1.2">
/*
Flashing Link Script-?Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions, 100's more DHTML scripts, and Terms Of Use,
Visit http://dynamicdrive.com
*/
if (document.all&&document.all.flashlink){
var flashlinks=document.all.flashlink
if (flashlinks.length==null)
flashlinks[0]=document.all.flashlink
function changecolor(which,type,color){
if (type==0){
if (flashlinks[which].style.color!=color)
flashlinks[which].style.color=color
else
flashlinks[which].style.color=''
}
else if (type==1){
if (flashlinks[which].style.backgroundColor!=color)
flashlinks[which].style.backgroundColor=color
else
flashlinks[which].style.backgroundColor=''
}
}
if (flashlinks.length==null){
var flashengine='setInterval("changecolor(0,'+flashlinks[0].flashtype+',\''+flashlinks[0].flashcolor+'\')",'+'1000)'
eval(flashengine)
}
else
for (i=0;i<flashlinks.length;i++){
var flashengine='setInterval("changecolor('+i+','+flashlinks[i].flashtype+',\''+flashlinks[i].flashcolor+'\')",'+'1000)'
eval(flashengine)
}
}
</script>
2使用方法
<a href="test.htm" id="flashlink" flashtype=0 flashcolor="green">Example 1</a>
<a href="test.htm" id="flashlink" flashtype=1 flashcolor="lime">Example 2</a>
在需要的地方加上 id=flashlink flashtype=? flashcolor=?
<script language="JavaScript1.2">
/*
Flashing Link Script-?Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions, 100's more DHTML scripts, and Terms Of Use,
Visit http://dynamicdrive.com
*/
if (document.all&&document.all.flashlink){
var flashlinks=document.all.flashlink
if (flashlinks.length==null)
flashlinks[0]=document.all.flashlink
function changecolor(which,type,color){
if (type==0){
if (flashlinks[which].style.color!=color)
flashlinks[which].style.color=color
else
flashlinks[which].style.color=''
}
else if (type==1){
if (flashlinks[which].style.backgroundColor!=color)
flashlinks[which].style.backgroundColor=color
else
flashlinks[which].style.backgroundColor=''
}
}
if (flashlinks.length==null){
var flashengine='setInterval("changecolor(0,'+flashlinks[0].flashtype+',\''+flashlinks[0].flashcolor+'\')",'+'1000)'
eval(flashengine)
}
else
for (i=0;i<flashlinks.length;i++){
var flashengine='setInterval("changecolor('+i+','+flashlinks[i].flashtype+',\''+flashlinks[i].flashcolor+'\')",'+'1000)'
eval(flashengine)
}
}
</script>
2使用方法
<a href="test.htm" id="flashlink" flashtype=0 flashcolor="green">Example 1</a>
<a href="test.htm" id="flashlink" flashtype=1 flashcolor="lime">Example 2</a>
在需要的地方加上 id=flashlink flashtype=? flashcolor=?
文章来源:http://www.aspxboy.com/myjs/baoku/0132.htm