加入收藏,滾動字幕,跑馬燈信息欄,圖像滾動,禁看源碼,時 間,波浪文字..代碼

 

加入收藏夾
在 <body> 與 </body> 之間加入:

<SCRIPT LANGUAGE=JavaScript>
function bookmarkit(){
window.external.addFavorite('http://material.myrice.com','一迪網絡'
)}
if (document.all)document.write('<a href="#" onClick="bookmarkit()"><strong>將本站加入收藏夾</strong></a>')
</SCRIPT>
 


設置爲首頁 
 
在 <body> 與 </body> 之間加入:

<span οnclick="var strhref="/window.location.href";
this.style.behavior='url(#default#homepage)';
this.setHomePage('http://5dcity.yeah.net');"
style="CURSOR: hand">
將本城設置爲首頁</span>
 
 
 

滾動字幕
 在 <body> 與 </body> 之間加入:

<TABLE BORDER="0" CELLSPACING="5" CELLPADDING="0" VSPACE="0" HSPACE="0" BORDERCOLOR="#B7B4B5">
<TR> <TD COLSPAN="2">
<!-DIRECTION=up/down/left/right/...>
<!-HEIGHT=字幕高度 WIDTH=字幕寬度>
<MARQUEE DIRECTION=up HEIGHT=150 WIDTH=100
ONMOUSEOUT=this.scrollDelay=1
ONMOUSEOVER=this.scrollDelay=600
SCROLLAMOUNT=1 SCROLLDELAY=1 CLASS="tt" >
滾動字幕效果<BR>
滾動字幕效果<BR>
滾動字幕效果<BR>
滾動字幕效果<BR>
滾動字幕效果<BR>
滾動字幕效果<BR>
滾動字幕效果<BR>
滾動字幕效果</MARQUEE>
</TD></TR> </TABLE>
 

跑馬燈式的信息欄
在 <head> 與 </head> 之間加入:

<script language="javascript">
function makearray(size)
{
this.length=size;
for(i=1;i<=size;i++)
{
this[i]=0
}
return this;
}
msg=new makearray(3)
msg[2]="嗨!您好。看見了嗎?"
msg[1]="您可根據自己的需要顯示不同的內容!";
msg[3]="可在這個窗口內顯示最新信息!"
interval = 100;
seq = 0;
i=1;
function Scroll() {
document.tmForm.tmText.value = msg[i].substring(0, seq+1);
seq++;
if ( seq >= msg[i].length ) { seq = 0 ;i++;interval=900};
if(i>3){i=1};
window.setTimeout("Scroll();", interval );interval=100
} ;
</script>

在 <body> 與 </body> 之間加入:

<form name="tmForm">
<p align="center">
<input type="Text" name="tmText" size="40">
</p></form>

把 <body> 改爲 <body onLoad="Scroll()" >
 
 
 
圖像滾動公告版 
 
在 <body> 與 </body> 之間加入:

<script language=JavaScript1.2>
/*設置下面的參數。 設置scrollerwidth和scrollerheight參數,設置成滾動顯示的圖片中尺寸最大的。*/
var scrollerwidth=157
var scrollerheight=157
var scrollerbgcolor='white'
//每個圖間暫停3秒。
var pausebetweenimages=3000
//邊界下面的行,如果希望logo都是帶連接的,只要加上<a>標籤即可。
var slideimages=new Array()
slideimages[0]='<a href="../images/020.jpg" target="_blank">
<img src="../images/020.jpg" width="150" height="150" border="0"></a>'
slideimages[1]='<a href="../images/023.jpg" target="_blank">
<img src="../images/023.jpg" width="150" height="150" border="0"></a>'
slideimages[2]='<a href="../images/006.jpg" target="_blank">
<img src="../images/006.jpg" width="150" height="150" border="0"></a>'
slideimages[3]='<a href="../images/008.jpg" target="_blank">
<img src="../images/008.jpg" width="150" height="150" border="0"></a>'
//儘管填加更多的。
//////以下不要修改////////////////
if (slideimages.length>1)
i=2
else
i=0
function move1(whichlayer){
tlayer=eval(whichlayer)
if (tlayer.top>0&&tlayer.top<=5){
tlayer.top=0
setTimeout("move1(tlayer)",pausebetweenimages)
setTimeout("move2(document.main.document.second)",pausebetweenimages)
return
}
if (tlayer.top>=tlayer.document.height*-1){
tlayer.top-=5
setTimeout("move1(tlayer)",100)
}
else{
tlayer.top=scrollerheight
tlayer.document.write(slideimages[i])
tlayer.document.close()
if (i==slideimages.length-1)
i=0
else
i++
}}
function move2(whichlayer){
tlayer2=eval(whichlayer)
if (tlayer2.top>0&&tlayer2.top<=5){
tlayer2.top=0
setTimeout("move2(tlayer2)",pausebetweenimages)
setTimeout("move1(document.main.document.first)",pausebetweenimages)
return
}
if (tlayer2.top>=tlayer2.document.height*-1){
tlayer2.top-=5
setTimeout("move2(tlayer2)",100)
}
else{
tlayer2.top=scrollerheight
tlayer2.document.write(slideimages[i])
tlayer2.document.close()
if (i==slideimages.length-1)
i=0
else
i++
}}
function move3(whichdiv){
tdiv=eval(whichdiv)
if (tdiv.style.pixelTop>0&&tdiv.style.pixelTop<=5){
tdiv.style.pixelTop=0
setTimeout("move3(tdiv)",pausebetweenimages)
setTimeout("move4(second2)",pausebetweenimages)
return
}
if (tdiv.style.pixelTop>=tdiv.offsetHeight*-1){
tdiv.style.pixelTop-=5
setTimeout("move3(tdiv)",100)
}
else{
tdiv.style.pixelTop=scrollerheight
tdiv.innerHTML=slideimages[i]
if (i==slideimages.length-1)
i=0
else
i++
}
}
function move4(whichdiv){
tdiv2=eval(whichdiv)
if (tdiv2.style.pixelTop>0&&tdiv2.style.pixelTop<=5){
tdiv2.style.pixelTop=0
setTimeout("move4(tdiv2)",pausebetweenimages)
setTimeout("move3(first2)",pausebetweenimages)
return
}
if (tdiv2.style.pixelTop>=tdiv2.offsetHeight*-1){
tdiv2.style.pixelTop-=5
setTimeout("move4(second2)",100)
}
else{
tdiv2.style.pixelTop=scrollerheight
tdiv2.innerHTML=slideimages[i]
if (i==slideimages.length-1)
i=0
else
i++
}}
function startscroll(){
if (document.all){
move3(first2)
second2.style.top=scrollerheight
}
else if (document.layers){
move1(document.main.document.first)
document.main.document.second.top=scrollerheight+5
document.main.document.second.visibility='show'
}}
window.οnlοad=startscroll
</script>
<script language=JavaScript1.2>
if (document.all){
document.writeln('<span id="main2" style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hiden;background-color:'+scrollerbgcolor+'">')
document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0;top:0">')
document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:0;top:1;">')
document.write(slideimages[0])
document.writeln('</div>')
document.writeln('<div id="second2" style="position:absolute;width:'+scrollerwidth+';left:0;top:0">')
document.write(slideimages[1])
document.writeln('</div>')
document.writeln('</div>')
document.writeln('</span>')
}
</script>
 
 
 
禁止查看源代碼 
 
在 <body> 與 </body> 之間加入:

<SCRIPT LANGUAGE=javascript>
function click()
{if (event.button==2)
{alert('歡迎光臨一迪網絡');}}
document.οnmοusedοwn=click
</SCRIPT>
 
 
 
現在的時間
在 <body> 與 </body> 之間加入:

<script LANGUAGE="JavaScript">
<!-- Begin
Stamp = new Date();
document.write('<font size="2" face="Arial"><B>' + (Stamp.getMonth() + 1) +"/"+Stamp.getDate()+ "/"+Stamp.getYear() + '</B></font><BR>');
var Hours;
var Mins;
var Time;
Hours = Stamp.getHours();
if (Hours >= 12) {
Time = " P.M.";
}
else {
Time = " A.M.";
}
if (Hours > 12) {
Hours -= 12;
}
if (Hours == 0) {
Hours = 12;
}
Mins = Stamp.getMinutes();
if (Mins < 10) {
Mins = "0" + Mins;
}
document.write('<font size="2" face="Arial"><B>' + Hours + ":" + Mins + Time + '</B></font>');
// End
// --></script>
 
 
 
不同時間的問候語 
 
在 <body> 與 </body > 之間加入:

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr> <td>
<div align="center"><br>

<script language="javaScript">
now = new Date(),hour = now.getHours()
if(hour < 6){document.write("凌晨好!")}
else if (hour < 9){document.write("早上好!")}
else if (hour < 12){document.write("上午好!")}
else if (hour < 14){document.write("中午好!")}
else if (hour < 17){document.write("下午好!")}
else if (hour < 19){document.write("傍晚好!")}
else if (hour < 22){document.write("晚上好!")}
else {document.write("夜裏好!")}
</script>

</div>
</td></tr>
</table>
 
 
 
波浪式飄動文字
在 <head> 與 </head> 之間加入:

<script>
message="Welcome to 5D CITY J***A download "
ns6switch=1

var ns6=document.getElementById&&!document.all
mes=new Array();
mes[0]=-1;
mes[1]=-4;
mes[2]=-7;mes[3]=-10;
mes[4]=-7;
mes[5]=-4;
mes[6]=-1;
num=0;
num2=0;
txt="";
function jump0(){
if (ns6&&!ns6switch){
jump.innerHTML=message
return
}
if(message.length > 6){
for(i=0; i != message.length;i++){
txt=txt+"<span style='position:relative;' id='n"+i+"'>"+message.charAt(i)+"</span>"};
jump.innerHTML=txt;
txt="";
jump1a()
}
else{
alert("http://www.jsshow.com")
}
}

function jump1a(){
nfinal=(document.getElementById)? document.getElementById("n0") : document.all.n0
nfinal.style.left=-num2;
if(num2 != 9){
num2=num2+3;
setTimeout("jump1a()",50)
}
else{
jump1b()
}
}

function jump1b(){
nfinal.style.left=-num2;
if(num2 != 0){num2=num2-3;
setTimeout("jump1b()",50)
}
else{
jump2()
}
}

function jump2(){
txt="";
for(i=0;i != message.length;i++){
if(i+num > -1 && i+num < 7){
txt=txt+"<span style='position:relative;top:"+mes[i+num]+"'>"+message.charAt(i)+"</span>"
}
else{txt=txt+"<span>"+message.charAt(i)+"</span>"}
}
jump.innerHTML=txt;
txt="";
if(num != (-message.length)){
num--;
setTimeout("jump2()",50)}
else{num=0;
setTimeout("jump0()",50)}}
</script>

在 <body> 與 </body> 之間加入:

<h2>
<div id="jumpx" style="color:33ff33"></div>
</h2>
<script>
if (document.all||document.getElementById){
jump=(document.getElementById)? document.getElementById("jumpx") : document.all.jumpx
jump0()
}
else
document.write(message)
</script>

轉至:http://www.blogercn.com/user1/8719/archives/2005/28320.shtml

發佈了43 篇原創文章 · 獲贊 3 · 訪問量 9萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章