欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

JavaScript實現(xiàn)標題欄文字輪播效果代碼

 更新時間:2015年10月24日 11:11:58   作者:企鵝  
這篇文章主要介紹了JavaScript實現(xiàn)標題欄文字輪播效果代碼,涉及JavaScript基于時間函數(shù)及流程控制操作標題欄文字的相關技巧,具有一定參考借鑒價值,需要的朋友可以參考下

本文實例講述了JavaScript實現(xiàn)標題欄文字輪播效果代碼。分享給大家供大家參考,具體如下:

這里演示的JS文字輪播,顯示在標題欄區(qū)域,以前個人主頁時候經(jīng)常見到的效果,不過現(xiàn)在都規(guī)范了,標題欄一般都不加入這種效果了。但是可以學習一下JS制作實現(xiàn)一些文字特效,運行效果后請查看標題欄。

運行效果截圖如下:

在線演示地址如下:

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>文字循環(huán)出現(xiàn)</title>
</head>
<body>
<SCRIPT LANGUAGE="JavaScript">
var message = new Array();
message[0] = "歡迎光臨腳本之家";
message[1] = "這里有javascript";
message[2] = "網(wǎng)頁特效";
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程序設計有所幫助。

相關文章

最新評論