一行文字逐渐变色效果,通过这个js脚本可实现这个文字变色特效,根据自己的需求来自定义改变速度及颜色。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <meta name="keywords" content="武鸣人网站,武鸣信息网,武鸣本地网,武鸣信息资源平台,减肥,健身,励志,励志语录,js特效,网页特效,www.wuming.ren"> <meta name="description" content="欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。"> <title>一行文字逐个变色显示特效_武鸣人</title> <style> .www_wuming_ren{ position:relative; width:1000px; } .comm{ font-size:35px; color:#ddd; font-family:黑体; position: absolute; top:0; left:0; } .red{ color: #0000FF; width: 0; overflow: hidden; white-space: nowrap; z-index: 10; }; </style> </head> <body> <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> <div class="www_wuming_ren"> <strong id="wuming_ren" class="comm">武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢!</strong> </div> <script> function getStyle( elem, name ) { if (elem.style[name]) return elem.style[name]; else if (elem.currentStyle) return elem.currentStyle[name]; else if (document.defaultView && document.defaultView.getComputedStyle) { name = name.replace(/([A-Z])/g,"-$1"); name = name.toLowerCase(); var s = document.defaultView.getComputedStyle(elem,""); return s && s.getPropertyValue(name);} else return null; }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) (function(){ var lb = document.getElementById("wuming_ren"), lt = lb.cloneNode(true), i = 0, sw = parseInt(getStyle(lb,'width')); lt.setAttribute('id',lb.getAttribute('id')+'1'); lt.className = 'comm red'; lb.parentNode.appendChild(lt); window.sliderFont = setInterval(function(){ parseInt(getStyle(lt,'width')) >= sw ? clearInterval(window.sliderFont) : lt.style['width'] = i++ + 'px'; },10); })(); </script> </body> </html>
本文来自武鸣人网站,转载请注明出处