js控制文字定时闪烁显示特效

2个月前 (05-25 16:52)阅读回复0
大陆
大陆
  • 管理员
  • 发消息
  • 注册排名1
  • 经验值5294
  • 级别管理员
  • 主题1058
  • 回复2
楼主

通过js脚本实现文字链接控制文字闪烁显示效果,并带有暂停闪烁功能,根据自己的需求来自定义文字及闪烁颜色。

<script>
function selectCode(f){
document.forms[f].elements[0].focus();
document.forms[f].elements[0].select();
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
function doNada(){self.focus()}
// blink speed in miliseconds
var rate = 500;
// the three blink colors
var Color1 = "#FF0000"
var Color2 = "#00FF00"
var Color3 = "#FF00FF"
var Color4 = "#FFcc00"
var Color5 = "#00FFcc"
var Color6 = "#FF00cc"
// the color if/when turned off (no-blink color)
var ColorX = "#FFcc00"
// set this to true for auto start; else, false
var DoIt = true
// do not edit below this line
// ---------------------------
bV  = parseInt(navigator.appVersion)
bNS = navigator.appName=="Netscape"
bIE = navigator.appName=="Microsoft Internet Explorer"
ok = false
var i=0;
function doTriStateRainbowLink(){
   ok =  true
   if ((bNS && bV >= 5) || (bIE && bV >= 4)){
      i++;
      if (i==1) C = Color1
      if (i==2) C = Color2
      if (i==3) C = Color3
  if (i==4) C = Color4
      if (i==5) C = Color5
      if (i==6) C = Color6
      if (!DoIt) C = ColorX
      if (bIE) BlinkLink.style.color=C
      if (bNS) document.getElementById('BlinkLink').style.color = C
      if (i > 5) i = 0
      if (DoIt) timer=setTimeout('doTriStateRainbowLink()', rate)
   }
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
function doOnOff(a){
   if (ok){
      if (a =="off") {DoIt = false}
      if ((a =="on")&&(!DoIt)) {
          DoIt = true
          doTriStateRainbowLink()
      }
   }
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
</script>
<body onLoad="doTriStateRainbowLink()">
<a href="https://www.wuming.ren">武鸣人</a>,各种信息资源免费发布,分享励志语录经典短句,减肥健身常识,各种js特效代码。网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)<hr>
<!--欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。-->
<script type="text/javascript" src="https://www.wuming.ren/ad/tc.js"></script>
<script type="text/javascript" src="https://www.wuming.ren/ad/a.js"></script>
<table border="0" cellpadding="17" cellspacing="0" width="40%">
<tr>
  <td width="100%" valign="middle" align="center"><font size="3" face="Arial"><b><a name="BlinkLink" id="BlinkLink" href="https://www.wuming.ren" target="_blank">武鸣人,各种信息免费发布,资源共享合作共赢!</a></b></font></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
  <table border="0" cellpadding="10" cellspacing="0" width="30%">
    <tr>
<td width="50%" valign="middle" align="center"><font face="Arial" size="2"><a href="javascript:doOnOff('off');doNada()">停止</a></font></td>
<td width="50%" valign="middle" align="center"><font face="Arial" size="2"><a href="javascript:doOnOff('on');doNada()">闪烁</a></font></td>
    </tr>
  </table>
</td>
</tr>
</table>
</body>


0
0
收藏0

本文来自武鸣人网站,转载请注明出处

本文地址:https://www.wuming.ren/a/1091.html

回帖

js控制文字定时闪烁显示特效 期待您的回复!

取消
载入表情清单……
载入颜色清单……
插入网络图片

取消确定

图片上传中
编辑器信息
提示信息