分享一款文字向左滚动显示效果,通过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 name="keywords" content="武鸣人网站,武鸣信息网,武鸣本地网,武鸣信息资源平台,减肥,健身,励志,励志语录,js特效,网页特效,www.wuming.ren"> <meta name="description" content="欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。"> <title>js实现文字向左动态滚动显示特效_武鸣人</title> <script type="text/JavaScript"> var POSITION = 50; var DELAY = 150; var www__wuming__ren = "武鸣人,各种信息免费发布,资源共享合作共赢!"; function bannerObject(){ this.msg = www__wuming__ren; this.out = " "; this.pos = POSITION; this.delay = DELAY; this.i = 0; this.reset = clearMessage; }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) function clearMessage(){ this.pos = POSITION; }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) var scroll = new bannerObject(); function scroller_wwwwumingren(){ scroll.out += " "; if(scroll.pos>0) for (scroll.i = 0; scroll.i < scroll.pos; scroll.i++){ scroll.out +=" " ; }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) if (scroll.pos>= 0) scroll.out += scroll.msg; else scroll.out = scroll.msg.substring(-scroll.pos,scroll.msg.length); document.www_wuming_ren.wuming_ren.value = scroll.out; scroll.out = " "; scroll.pos--; scroll.pos--; if (scroll.pos < -(scroll.msg.length)) { scroll.reset(); }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) window.setTimeout("scroller_wwwwumingren()", scroll.delay); }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) </script> </head> <body onload="scroller_wwwwumingren()"> <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" cellspacing="0" cellpadding="0"> <tr><td width="100%"> <form name="www_wuming_ren" action="https://www.wuming.ren"> <p><input type="text" name="wuming_ren" size="50" style="background-color: rgb(192,192,192)"/></p> </form> </td></tr> </table> </body> </html>
本文来自武鸣人网站,转载请注明出处