將以下程式碼複製,貼在<body>及</body>標籤之間。
<script language:JavaScript>
<!--
today= new Date()
dateValue=today.getYear()+"年"+(today.getMonth()+1)+"月"+today.getDate()+"日";
window.alert("紫蓮の翼\n\http://blog.pixnet.net/como0925
\n\n今天是"+dateValue);
-->
</script>
自行修改訊息的內容;可加入\n斷行
目前分類:網頁語法特效~訊息、文字 (48)
- May 31 Sat 2008 19:55
訊息+日期
- May 31 Sat 2008 19:51
變化式訊息欄
語法展示:: http://home.graffiti.net/ghjkjkgh/
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<body>及</body>標籤之間。
<script language="JavaScript1.2">
<!--
var delay=5000
var fcontent=new Array()
begintag='<font face="細明體" size=2>'
fcontent[0]="<font color=#FF00FF>Java Script</font>是一個Java Applet程式語言的簡易版本,它是由Netscape與Sun這兩家公司在1995年底所制定的,早期是為了在Navigator 2.0上設計動態網頁而設計的,"
fcontent[1]="它部份取自Java Applet的精髓,但並不提供例如Java Applet的類別與繼承的特性。<font color=#FF00FF>Java Script</font>程式是HTML檔案的一部份,放在標籤<script>與</script>當中,"
fcontent[2]="和Java Applet不同的是,<font color=#FF00FF>Java Script</font>是純粹的直譯語言,也因如此,它的功能較單純,必須要搭配HTML檔案才能被執行;相反的,<font color=#FF00FF>Java Script</font>程式可以製作成Java Applet來執行。"
closetag='</font>'
var fwidth=450
var fheight=50
var ie4=document.all&&!document.getElementById
var ns4=document.layers
var DOM2=document.getElementById
var faderdelay=0
var index=0
if (DOM2)
faderdelay=2000
function changecontent(){
if (index>=fcontent.length)
index=0
if (DOM2){
document.getElementById("fscroller").style.color="rgb(255,255,255)"
document.getElementById("fscroller").innerHTML=begintag+fcontent[index]+closetag
colorfade()
}
else if (ie4)
document.all.fscroller.innerHTML=begintag+fcontent[index]+closetag
else if (ns4){
document.fscrollerns.document.fscrollerns_sub.document.write(begintag+fcontent[index]+closetag)
document.fscrollerns.document.fscrollerns_sub.document.close()
}
index++
setTimeout("changecontent()",delay+faderdelay)
}
frame=20;
hex=255
function colorfade() {
if(frame>0) {
hex-=12;
document.getElementById("fscroller").style.color="rgb("+hex+","+hex+","+hex+")";
frame--;
setTimeout("colorfade()",20);
}
else{
document.getElementById("fscroller").style.color="rgb(0,0,0)";
frame=20;
hex=255
}
}
if (ie4||DOM2)
document.write('<div id="fscroller" style="border:1px solid black;width:'+fwidth+';height:'+fheight+';padding:2px"></div>')
window.onload=changecontent
-->
</script>
- May 31 Sat 2008 19:46
打字式訊息欄2
語法展示:: http://home.graffiti.net/oedfrf/
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<body>及</body>標籤之間。
<script language=JavaScript>
<!--
var newsText = new Array();
newsText[0] = "打字式訊息欄2與打字式訊息欄1不同之處......";
newsText[1] = "差別在打字式訊息欄2可設定是否一直重複顯示訊息";
var ttloop = 0;
var tspeed = 100;
var tdelay = 2000;
var dwAText, cnews=0, eline=0, cchar=0, mxText;
function doNews() {
mxText = newsText.length - 1;
dwAText = newsText[cnews];
setTimeout("addChar()",1000)
}
function addNews() {
cnews += 1;
if (cnews <= mxText) {
dwAText = newsText[cnews];
if (dwAText.length != 0) {
document.news.news2.value = "";
eline = 0;
setTimeout("addChar()",tspeed)
}
}
}
function addChar() {
if (eline!=1) {
if (cchar != dwAText.length) {
nmttxt = ""; for (var k=0; k<=cchar;k++) nmttxt += dwAText.charAt(k);
document.news.news2.value = nmttxt;
cchar += 1;
if (cchar != dwAText.length) document.news.news2.value += "_";
} else {
cchar = 0;
eline = 1;
}
if (mxText==cnews && eline!=0 && ttloop!=0) {
cnews = 0; setTimeout("addNews()",tdelay);
} else setTimeout("addChar()",tspeed);
} else {
setTimeout("addNews()",tdelay)
}
}
doNews()
-->
</script>
<form name="news">
<center>
<textarea name="news2" cols=38 rows=2></textarea>
</center>
</form>
在 var ttloop = 0; 中修改訊息是否一直重複(1→要 0→不要) |
在 var tspeed = 100; 中修改訊息的速度 |
在 var tdelay = 2000; 中修改訊息與訊息之間相隔的時間(每1秒=1000) |
自行修改訊息的內容 |
- May 31 Sat 2008 19:37
打字式訊息欄1
語法展示:: http://home.graffiti.net/bnmmhjgjghj/
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<body>及</body>標籤之間。
<form name=tickform>
<center>
<textarea name=tickfield rows=2 cols=38></textarea>
</center>
</form>
將以下程式碼複製,貼在<head>及</head>標籤之間。
<script language=JavaScript>
<!--
var max=0;
function textlist() {
max=textlist.arguments.length;
for (i=0; i<max; i++)
this[i]=textlist.arguments[i];
}
tl = new textlist(
"紫蓮の翼 http://blog.pixnet.net/como0925",
"有空來逛逛~也幫紫蓮點擊廣告ㄛ",
"紫蓮會努力分享更多的各種資料"
);
var x = 0; pos = 0;
var l = tl[0].length;
function textticker() {
document.tickform.tickfield.value = tl[x].substring(0, pos) + "_";
if(pos++ == l) {
pos = 0;
setTimeout("textticker()", 1000);
if(++x == max) x = 0;
l = tl[x].length;
} else
setTimeout("textticker()", 200);
}
-->
</script>在 setTimeout("textticker()", 1000); 中修改訊息之間間隔的時間(每1秒=1000) 在 setTimeout("textticker()", 200); 中修改打字的速度(每1秒=1000) 自行修改訊息的內容及數量
將以下程式碼複製,貼在<body >標籤裡面。
OnLoad="textticker()"
- May 31 Sat 2008 19:30
訊息欄跑馬燈2
語法展示:: http://home.graffiti.net/jkfgjfgcj/
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<body>及</body>標籤之間。
<center>
<form name=tickform>
<textarea cols=14 name=tickfield rows=4></textarea>
</form>
</center>
在 cols=14 中修改跑馬燈的寬度 |
在 rows=4 中修改跑馬燈的高度 |
將以下程式碼複製,貼在<head>及</head>標籤之間。
<script language="JavaScript">
<!--
var msg="歡迎光臨i i喔喔~有空多來逛逛\n請踴躍推薦本站\n投稿語法\n及交換連結";
seq=0;
function horse1()
{
document.tickform.tickfield.value=
msg.substring(msg.length,seq);
if(seq>=msg.length) {seq=0};seq++;
window.setTimeout('horse1()',150);
}
-->
</script>在 var msg="歡迎光臨i i喔喔~有空多來逛逛\n請踴躍推薦本站\n投稿語法\n及交換連結";
中修改訊息的文字,可加入\n 斷行在 window.setTimeout('horse1()',150); 中修改跑馬燈的速度
將以下程式碼複製,貼在<body >標籤裡面。
onLoad="horse1();"
- May 31 Sat 2008 19:25
訊息欄跑馬燈1
語法展示:: http://home.graffiti.net/cxdfghh/
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<body>及</body>標籤之間。
<script language="JavaScript">
function selectScroller(n) {
optlist = document.scrollform.scroller;
optlist[optlist.length] = new Option(optlist[0].text, "", false, false);
optlist[0] = null;
optlist.selectedIndex = -1;
n = (n + 1) % optlist.length;
setTimeout("selectScroller("+n+")",2000);
}
</script>
<center>
<form name="scrollform">
<select name="scroller" size="4">
<option></option>
<option></option>
<option></option>
<option></option>
<option>白日依山盡</option>
<option>黃河入海流</option>
<option>欲窮千里目</option>
<option>更上一層樓</option>
<option></option>
<option></option>
<option></option>
<option></option>
<option>床前明月光</option>
<option>疑是地上霜</option>
<option>舉頭望明月</option>
<option>低頭思故鄉</option>
<option></option>
<option></option>
<option></option>
<option></option>
<option>春眠不覺曉</option>
<option>處處聞啼鳥</option>
<option>夜來風語聲</option>
<option>花落知多少</option>
<option></option>
<option></option>
<option></option>
<option></option>
</select>
</form>
</center>
將以下程式碼複製,貼在<body >標籤裡面。
OnLoad="selectScroller(0);"
- May 31 Sat 2008 19:15
訊息欄
語法展示:: http://home.graffiti.net/kdhdfgee/
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<body>及</body>標籤之間。
<center>
<form>
<textarea name="teletype" rows=3 cols=50 wrap=yes ></textarea>
<br><br>
<table border=0 width=250>
<td align="center"><input type="button" value="上一則" onClick="lastMessage()">
<td align="center"><input type="text" size=3>
<td align="center"><input type="button" value="下一則" onClick="nextMessage()">
</table>
</form>
</center>
在 <textarea name="teletype" rows=3 cols=50 wrap=yes > 中修改訊息欄的高度及寬度
將以下程式碼複製,貼在<head>及</head>標籤之間。
<script language="JavaScript">
<!--
// used to track position in message
var i = 0;
// used to cycle thru messages
var TextNumber = -1;
// array of messages
var TextInput = new Object();
// used to load manipulate message
var HelpText="";
// used to load message
var Text = "";
// length of timeout (smaller is faster)
var Speed=50;
// used to display message number
var message=0;
// used to position text in ver 2.0
var addPadding="\r\n";
// Each element of TextInput represents a single message.
TextInput[0] = "歡迎光臨!!";
TextInput[1] = "有空請多來逛逛~要幫我點擊廣告ㄛ!";
TextInput[2] = "你真的有去點擊廣告嗎......";
TotalTextInput = 2; // (0, 1, 2, 3, 4, 5, 6, 7)
// Positioning and speed vary between versions.
var Version = navigator.appVersion;
if (Version.substring(0, 1)==3)
{
Speed=100;
addPadding="";
}
for (var addPause = 0; addPause <= TotalTextInput; addPause++)
{TextInput[addPause]=addPadding+TextInput[addPause];}
var TimerId
var TimerSet=false;
// Called by >>> button (display next message) .
function nextMessage()
{
if (!TimerSet)
{
TimerSet=true;
clearTimeout (TimerId);
if (TextNumber>=TotalTextInput)
{
alert("訊息結束!");
TimerSet=false;
}
else
{
TextNumber+=1;
message=TextNumber+1;
document.forms[0].elements[2].value= message;
Text = TextInput[TextNumber];
HelpText = Text;
}
teletype();
}
}
// Gets and displays character from rollMessage() .
// Variable Speed controls length of timeout and thus the speed of typing.
function teletype()
{
if (TimerSet)
{
Text=rollMessage();
TimerId = setTimeout("teletype()", Speed);
document.forms[0].elements[0].value=Text;
}
}
// Pulls one character at a time from string and returns (as Text) to function teletype() for displaying.
function rollMessage ()
{
i++;
var CheckSpace = HelpText.substring(i-1, i);
CheckSpace = "" + CheckSpace;
if (CheckSpace == " ")
{i++;}
if (i >= HelpText.length+1)
{
TimerSet=false;
Text = HelpText.substring(0, i);
i=0;
return (Text);
}
Text = HelpText.substring(0, i);
return (Text);
}
// Initially called by onLoad in BODY tag to load title.
function initTeleType()
{
Text="\r\n 訊息欄──按下面按鈕可逐一瀏覽訊息";
document.forms[0].elements[0].value=Text;
}
// Called by <<< button (get previous message).
function lastMessage()
{
if (!TimerSet && TextNumber!=-1)
{
TimerSet=true;
clearTimeout (TimerId);
if (TextNumber<=0)
{
alert("之前已無訊息!");
TimerSet=false;
}
else
{
TextNumber-=1;
message=TextNumber+1;
document.forms[0].elements[2].value= message;
Text = TextInput[TextNumber];
HelpText = Text;
}
teletype();
}
}
-->
</script>在 TextInput[0] = "歡迎光臨!!";
TextInput[1] = "有空請多來逛逛~要幫我點擊廣告ㄛ!";
TextInput[2] = "你真的有去點擊廣告嗎......";
中修改要顯示的文字在 Text="\r\n 訊息欄──按下面按鈕可逐一瀏覽訊息"; 中修改預設訊息
將以下程式碼複製,貼在<body >標籤裡面。
onLoad="initTeleType()"
- May 31 Sat 2008 19:09
隨機提示
語法展示:: http://home.graffiti.net/ghjhdfghfx/
請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<body>及</body>標籤之間。
<script language="JavaScript">
<!--
tips = new Array(4);
tips[0] = "哈囉~";
tips[1] = "吃飽了嗎";
tips[2] = "再按次重新整理看看!";
tips[3] = "有空多來逛逛喔";
index = Math.floor(Math.random() * tips.length);
document.write("<CENTER><FONT SIZE=5 COLOR=#FF00FF>" + tips[index] + "</CENTER></FONT>");
-->
</script>在 tips = new Array(4); 中修改訊息的數量 修改中文部份的訊息 在 <FONT SIZE=5 COLOR=#FF00FF> 中修改訊息的文字大小及顏色