闪烁的连接

发布时间:2007年02月01日      浏览次数:1183 次
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=?
文章来源:http://www.aspxboy.com/myjs/baoku/0132.htm
免责声明:本站相关技术文章信息部分来自网络,目的主要是传播更多信息,如果您认为本站的某些信息侵犯了您的版权,请与我们联系,我们会即时妥善的处理,谢谢合作!