JavaScript實現標題列文字輪播效果代碼,javascript標題列

來源:互聯網
上載者:User

JavaScript實現標題列文字輪播效果代碼,javascript標題列

本文執行個體講述了JavaScript實現標題列文字輪播效果代碼。分享給大家供大家參考,具體如下:

這裡示範的JS文字輪播,顯示在標題列地區,以前個人首頁時候經常見到的效果,不過現在都規範了,標題列一般都不加入這種效果了。但是可以學習一下JS製作實現一些文字特效,運行效果後請查看標題列。

運行效果如下:

線上示範地址如下:

http://demo.jb51.net/js/2015/js-title-loop-show-style-demo/

具體代碼如下:

<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>文字迴圈出現</title></head><body><SCRIPT LANGUAGE="JavaScript">var message = new Array();message[0] = "歡迎光臨幫客之家";message[1] = "這裡有javascript";message[2] = "網頁特效";message[3] = "圖片和背景特效等";message[4] = "非常多的資源";message[5] = "你一定會有所收穫的"; message[6] = "歡迎你再次光臨";message[7] = "";var reps = 2;var speed = 60;var p = message.length;var T = "";var C = 0;var mC = 0;var s = 0;var sT = null;if (reps < 1) reps = 1;function doTheThing() {T = message[mC];A();}function A() {s++;if (s > 9) { s = 1;}if (s == 1) { document.title = '|||★★★★★=====|||----- ['+T+' -----'; }if (s == 2) { document.title = '|||=★★★★★====|||----- ['+T+' -----'; }if (s == 3) { document.title = '|||==★★★★★===|||----- ['+T+' -----'; }if (s == 4) { document.title = '|||===★★★★★==|||----- ['+T+' -----'; }if (s == 5) { document.title = '|||====★★★★★=|||----- ['+T+' -----'; }if (s == 6) { document.title = '|||=====★★★★★|||----- ['+T+' -----'; }if (s == 7) { document.title = '|||====★★★★★=|||----- ['+T+' -----'; }if (s == 8) { document.title = '|||===★★★★★==|||----- ['+T+' -----'; }if (s == 9) { document.title = '|||=★★★★★===|||----- ['+T+' -----'; }if (C < (8 * reps)) {sT = setTimeout("A()", speed);C++;}else {C = 0;s = 0;mC++;if(mC > p - 1) mC = 0;sT = null;doTheThing();  }}doTheThing();</script></body></html>

希望本文所述對大家JavaScript程式設計有所協助。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.