网站常用代码  

       1.波浪文字

  <script language="JavaScript">
function makeArray(n){
this.length=n
return this
}

function hexfromdec(num) {
hex=new makeArray(1);
var hexstring="";
var shifthex=16;
var temp1=num;
for(x=1; x>=0; x--) {
hex[x]=Math.round(temp1/shifthex - .5);
hex[x-1]=temp1 - hex[x] * shifthex;
temp1=hex[x-1];
shifthex /= 16;
}
for (x=1; x>=0; x--) { hexstring+=getletter(hex[x]); }
return (hexstring);
}

function getletter(num) {
if (num < 10) { return num; } 
else {
if (num == 10) { return "A" }
if (num == 11) { return "B" }
if (num == 12) { return "C" }
if (num == 13) { return "D" }
if (num == 14) { return "E" }
if (num == 15) { return "F" }
}
}

function rainbow(text){
var color_d1;
var allstring="";
for(i=0;i<text.length;i=i+2){
color_d1=255*Math.sin(i/(text.length/3));
color_h1=hexfromdec(color_d1);
allstring+="<FONT COLOR="+color_h1+"ff"+color_h1+">"+text.substring(i,i+2)+"</FONT>";
}
return allstring;
}

function sizefont(text){
var color_d1;
var allstring="";
var flag=0;
for(i=0,j=0;i<text.length;i=i+1){
if (flag==0) {
j++;
if (j>=7) {
flag=1;}}
if (flag==1) { 
j=j-1;
if (j<=0) {
flag=0; }}
allstring+="<FONT SIZE="+ j + ">" + text.substring(i,i+1) + "</FONT>";
}
return allstring;
}
document.write("<font size=5><CENTER>")
document.write("<BR><BR>")
document.write( sizefont("子文阁网站"))
document.write("</CENTER></font>")
</script>

  2.立体旋转文字

<SCRIPT language=javascript>
//luxiaoqing
Phrase="欢迎你的光临"
Balises=""
Taille=40;
Midx=100;
Decal=0.5;
Nb=Phrase.length;
y=-10000;
for (x=0;x<Nb;x++){
Balises=Balises + '<DIV Id=L' + x + ' STYLE="width:3;font-family: Courier New;font-weight:bold;position:absolute;top:40;left:50;z-index:0">' + Phrase.charAt(x) + '</DIV>'
}
document.write (Balises);
Time=window.setInterval("Alors()",10);
Alpha=5;
I_Alpha=0.05;

function Alors(){
Alpha=Alpha-I_Alpha;
for (x=0;x<Nb;x++){
Alpha1=Alpha+Decal*x;
Cosine=Math.cos(Alpha1);
Ob=document.all("L"+x);
Ob.style.posLeft=Midx+100*Math.sin(Alpha1)+50;
Ob.style.zIndex=20*Cosine;
Ob.style.fontSize=Taille+25*Cosine;
Ob.style.color="rgb("+ (27+Cosine*80+50) + ","+ (127+Cosine*80+50) + ",0)";
}
}

</SCRIPT>

 

  3.文字一个个打出来

  <p id='anima' style="position:absolute;font-size:20;background-color:white;"></p>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
text = "中国天蓝网欢迎你的光临,请多提意见,谢谢!zgtlan.126.com:-)"
word = text.split('.')
i = -1; //letter count
j = 0; //which word in array is to be spelled
start = 0; //variable to hold cycles of the blink
scount = 0; //variable to hold cycles of the mispell
function checkIt() {
with(document.all.anima) {
if(innerText.charAt(innerText.length-1) == "_") {
innerText = innerText.substring(0, innerText.length - 1);
return true;
}
else {
innerText = innerText + "_";
return false;
}
}
}
function blinkfor(count, timing) {
with(document.all.anima) {
if(start < count) {
if(checkIt()) {
start++;
}
mistake = 'blinkfor('+count+','+timing+')';
setTimeout('eval(mistake)', timing);
}
else {
start = 0;
i++;
call_It();
}
}
}
function mispell(offset,correction) {
with(document.all.anima) {
if(scount < offset) {
if(!checkIt()) {
innerText = innerText.substring(0, innerText.length-2) + "_";
scount++;
}
mistake = 'mispell(' + offset + ', "' + correction + '")';
setTimeout("eval(mistake)", 150);
}
else {
if(correction == '' && scount == offset ) {
i = i - offset;
scount++;
}
if(offset > 0) {
if(checkIt()) {
innerText += correction.charAt(correction.length - offset) + "_";
offset--;
}
mistake = 'mispell(' + offset + ',"' + correction + '")';
setTimeout("eval(mistake)", 150);
}
else {
scount = 0;
j++;
innerText = innerText.substring(0, innerText.length - 1);
call_It();
}
}
}
}
function spellit(string) {
with(document.all.anima) {
if(i <= string.length) {
if(string.charAt(i) == '/') {
NumErrs = string.charAt(i + 1);
NewLets = string.substring(i + 2, i + NumErrs);
mispell(NumErrs,NewLets);
}
else if(i <= string.length - 1) {
i++;
innerText = string.substring(0,i) + "_";
mistake = 'spellit("' + string + '")';
setTimeout("eval(mistake)", 150);
}
else {
innerText = string.substring(0, i);
j++;
call_It();
}
}
}
}
function call_It() {
with(document.all) {
if(i == -1){
blinkfor(4, 150);
}
else if(j <= word.length - 1) {
spellit(anima.innerText + " " + word[j]);

else {
blinkfor(100,230);
}
}
}
if(document.all) {
call_It();
}
// End -->
</script>

  4.水韵效果页面

  <script language="JavaScript">
<!-- 
I=new Image();
I.src="0109ring.gif";
if (document.all){
document.write('<div id="C" style="position:absolute;top:0px;left:0px">');
document.write('<div style="position:relative">');
document.write('<img id="pic" src="0109ring.gif" style="position:absolute;top:0px;left:0px">');
document.write('</div></div>');
}
S=null,fadeStep=4,fade=80,currentStep=0,step=2,RY=0,RX=0,Yarea=0,Xarea=0;
function Expand(){
if (document.all){
pic.width=currentStep*2;
pic.height=currentStep*2;
pic.style.top= -currentStep;
pic.style.left= -currentStep;
pic.style.filter='alpha(opacity='+fade+')';
currentStep+=step;
if (currentStep > 20) fade-=fadeStep;
if (fade < -50) 
{
currentStep=0;
fade=80;
Yarea=window.document.body.clientHeight-80;
Xarea=window.document.body.clientWidth-80;
RY=Math.round(50+Math.random()*Yarea);
RX=Math.round(50+Math.random()*Xarea);
C.style.top=RY+document.body.scrollTop;
C.style.left=RX+document.body.scrollLeft;
}
S=setTimeout('Expand()',40);
}
}
if (document.all)window.onload=Expand; 

if (document.layers)
{
alert("Your Browser is not capable of displaying this effect.\nPick another.");
opener.gO();window.close();
}
// -->
</script>
<div style="position:relative"></div>

  5首页拉幕效果

  <div id="i1" class="intro"> 
</div> 
<div id="i2" class="intro"> 
</div> 
<script language="JavaScript1.2"> 
var speed=20 
var temp=new Array() 
var temp2=new Array() 
if (document.layers){ 
for (i=1;i<=2;i++){ 
temp[i]=eval("document.i"+i+".clip") 
temp2[i]=eval("document.i"+i) 
temp[i].width=window.innerWidth/2 
temp[i].height=window.innerHeight 
temp2[i].left=(i-1)*temp[i].width 


else if (document.all){ 
var clipright=document.body.clientWidth/2,clipleft=0 
for (i=1;i<=2;i++){ 
temp[i]=eval("document.all.i"+i+".style") 
temp[i].width=document.body.clientWidth/2 
temp[i].height=document.body.offsetHeight 
temp[i].left=(i-1)*parseInt(temp[i].width) 




function openit(){ 
window.scrollTo(0,0) 
if (document.layers){ 
temp[1].right-=speed 
temp[2].left+=speed 
if (temp[2].left>window.innerWidth/2) 
clearInterval(stopit) 

else if (document.all){ 
clipright-=speed 
temp[1].clip="rect(0 "+clipright+" auto 0)" 
clipleft+=speed 
temp[2].clip="rect(0 auto auto "+clipleft+")" 
if (clipright<=0) 
clearInterval(stopit) 



function gogo(){ 
stopit=setInterval("openit()",100) 

gogo() 

</script>
<style>
<!--
.intro {
position:absolute;
left:0;
top:0;
layer-background-color:red;
background-color:red;
border:0.1px solid red
}
-->
</style> 

  6.图片上下飘动

  <SCRIPT language=javascript>
<!-- Begin
var ns4up = (document.layers) ? 1 : 0; 
var ie4up = (document.all) ? 1 : 0;
var no = 1; // pic number
var speed = 20; // smaller number moves the pic faster
var snowflake = "cat1.gif"; //pic image
var filen = "http://www.javascript2000.com/" // link web file
var dx, xp, yp; // coordinate and position variables
var am, stx, sty; // amplitude and step variables
var i, doc_width = 400, doc_height = 600;
if (ns4up) {
doc_width = self.innerWidth;
doc_height = self.innerHeight;
} else if (ie4up) {
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
dx = new Array();
xp = new Array();
yp = new Array();
am = new Array();
stx = new Array();
sty = new Array();
for (i = 0; i < no; ++ i) 

dx[i] = 0; // set coordinate variables
xp[i] = Math.random()*(doc_width-50); // set position variables
yp[i] = Math.random()*doc_height;
am[i] = Math.random()*20; // set amplitude variables
stx[i] = 0.02 + Math.random()/10; // set step variables
sty[i] = 0.7 + Math.random(); // set step variables
if (ns4up) { // set layers
if (i == 0) {
document.write("<html><title></title><body>");
document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");
document.write("top=\"15\" visibility=\"show\"><A href=\"" + filen + "\" target=\"_blank\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></layer>");
document.write("</body></html>");
} else {
document.write("<html><title></title><body>");
document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");
document.write("top=\"15\" visibility=\"show\"><A href=\"" + filen + "\" target=\"_blank\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></layer>");
document.write("</body></html>");
}
} else if (ie4up) {
if (i == 0) {
document.write("<html><title></title><body>");
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
document.write("visible; TOP: 15px; LEFT: 15px;\"><a href=\""+filen+"\" target=\"_blank\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></div>");
document.write("</body></html>");
} else {
document.write("<html><title></title><body>");
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
document.write("visible; TOP: 15px; LEFT: 15px;\"><a href=\""+filen+"\" target=\"_blank\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></div>");
document.write("</body></html>");
}
}
}
function snowNS() { // Netscape main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
yp[i] += sty[i];
if (yp[i] > doc_height-50) {
xp[i] = Math.random()*(doc_width-am[i]-30);
yp[i] = 0;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
doc_width = self.innerWidth;
doc_height = self.innerHeight;
}
dx[i] += stx[i];
document.layers["dot"+i].top = yp[i];
document.layers["dot"+i].left = xp[i] + am[i]*Math.sin(dx[i]);
}
setTimeout("snowNS()", speed);
}
function snowIE() { // IE main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
yp[i] += sty[i];
if (yp[i] > doc_height-50) {
xp[i] = Math.random()*(doc_width-am[i]-30);
yp[i] = 0;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
dx[i] += stx[i];
document.all["dot"+i].style.pixelTop = yp[i];
document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]);
}
setTimeout("snowIE()", speed);
}
if (ns4up) {
snowNS();
} else if (ie4up) {
snowIE();
}
// End -->
</SCRIPT>

   7、一个特别酷的导航菜单,绝对棒!

 <SCRIPT language=JavaScript>
var currentpos,timer; 
function initialize() 

timer=setInterval("scrollwindow()",10); 

function sc(){ 
clearInterval(timer); 

function scrollwindow() 

currentpos=document.body.scrollTop; 
window.scroll(0,++currentpos); 
if (currentpos != document.body.scrollTop) 
sc(); 

document.onmousedown=sc 
document.ondblclick=initialize 
</script>
<SCRIPT language=JavaScript>
<!--
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->

function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
obj.visibility=v; }
}
//-->
</SCRIPT>
<script language="JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
<style type="text/css">
body td {color:#ffffff;font-family: "MS Shell Dlg";font-size: 9pt; letter-spacing:1px;}
A:link {color: #ffffff;text-decoration: none;letter-spacing:1px;}
A:visited {color: #999999;text-decoration: none;letter-spacing:1px;}
A:active {text-decoration: none;letter-spacing:1px;}
A:hover {text-decoration: none;color: #99cc00;letter-spacing:1px;}
.border { border: #000000; border-style: solid; border-width: 1px}
.unnamed1 { font-family: "Arial"; font-size: 7pt; font-style: normal; line-height: 7pt; color: #FFFFFF; font-weight: 900;letter-spacing:1px;}
.unnamed2 { font-size: 12px; color: #FFFFFF; text-decoration: none; line-height: 12pt;letter-spacing:1px;}
.button { border: 1px #99cc00 solid; background-color: #4d4d4d; color: #FFFFFF}

</style>
<script language="JavaScript">
<!--
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->

function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}
//-->
</script>
</head>
<body marginheight="0" marginwidth="0" leftmargin="0" topmargin="0" bgcolor="#000000" class="bg"><table width="100%" border="0" cellspacing="0" align="center" height="100%" cellpadding="0" bgcolor="#000000" > 
<tr> 
<td colspan="3" background="images/bg-top.gif" valign="top"> 
<table width="140" border="0" cellspacing="0" cellpadding="1">
<tr>
<td colspan="3">
<div id="Layer1" style="position:absolute; width:90px; height:20px; z-index:2"> 
<div id="Layer2" style="position:absolute; width:300px; height:20px; onMouseOut=; left: 68; top: 0; visibility: hidden; z-index: 1" MM_showHideLayers('Layer2','','hide')" 
onMouseOver="MM_showHideLayers('Layer2','','show')" class="unnamed2"><font face="Courier New, Courier, mono" color="#99CC00"> -</font> 
<a href="http://www.cwdcn.com/photo.php?photo_id=2">平面</a> 
<font face="Courier New, Courier, mono" color="#99CC00">-</font> 
<a href="http://www.cwdcn.com/carton.php?photo_id=3">卡通</a> 
<font face="Courier New, Courier, mono" color="#99CC00">-</font> 
<a href="http://www.cwdcn.com/post.php?photo_id=4">三维</a> 
<font face="Courier New, Courier, mono" color="#99CC00">-</font> 
<a href="http://www.cwdcn.com/website.php?photo_id=5">网页</a> 
<font face="Courier New, Courier, mono" color="#99CC00">-</font> 
<a href="http://www.cwdcn.com/other.php?photo_id=6">其它</a> 
<font face="Courier New, Courier, mono" color="#99CC00">-</font> 
<a href="flash.htm">Flash</a> </div>
<div id="Layer3" style="position:absolute; width:300px; height:20px; onMouseOut=; left: 87; top: 17; visibility: hidden; z-index: 1" onMouseOut="MM_showHideLayers('Layer3','','hide')" 
onMouseOver="MM_showHideLayers('Layer3','','show')" class="unnamed2"> <font face="Courier New, Courier, mono" color="#99CC00"> -</font> 
<a href="http://www.cwdcn.com/membershow.php?url_type=教学类">教学</a> 
<font face="Courier New, Courier, mono" color="#99CC00">-</font> 
<a href="http://www.cwdcn.com/membershow.php?url_type=商业类">商业</a> 
<font face="Courier New, Courier, mono" color="#99CC00">-</font> 
<a href="http://www.cwdcn.com/membershow.php?url_type=个性类">个性</a> 
<font face="Courier New, Courier, mono" color="#99CC00">-</font> 
<a href="http://www.cwdcn.com/membershow.php?url_type=网页类">网页</a> 
<font face="Courier New, Courier, mono" color="#99CC00">-</font> 
<a href="http://www.cwdcn.com/membershow.php?url_type=艺术类">艺术</a> 
</div>
<div id="Layer4" style="position:absolute; width:300px; height:20px; onMouseOut=; left: 104; top: 34; visibility: hidden; z-index: 1" onMouseOut="MM_showHideLayers('Layer4','','hide')" 
onMouseOver="MM_showHideLayers('Layer4','','show')" class="unnamed2"> <font face="Courier New, Courier, mono" color="#99CC00"> -</font> 
<a href="coolweb.php">推荐</a> <font face="Courier New, Courier, mono" color="#99CC00">-</font> 
<a href="about.htm">组成</a> <font face="Courier New, Courier, mono" color="#99CC00">-</font> 
<a href="story.htm">网事</a> <font face="Courier New, Courier, mono" color="#99CC00">-</font> 
<a href="service.php">服务</a> <font face="Courier New, Courier, mono" color="#99CC00">-</font> 
<a href="links.php">链接</a></div>
</div>
</td>
</tr>
<tr> 
<td colspan="3"><img src="abc.gif" width="11" height="11" align="absmiddle"> 
<a href="#" 
onMouseOut="MM_showHideLayers('Layer2','','hide')" 
onMouseOver="MM_showHideLayers('Layer2','','show')" class="unnamed2"><font color="#ffffff"> 
原创作品</font></a> 
</td>
</tr>
<tr> 
<td width="17"> </td>
<td colspan="2"><img src="abc.gif" width="11" height="11" align="absmiddle"> 
<a href="#" 
onMouseOut="MM_showHideLayers('Layer3','','hide')" 
onMouseOver="MM_showHideLayers('Layer3','','show')" class="unnamed2"><font color="#ffffff"> 
联盟站点</font></a>
</td>
</tr>
<tr> 
<td colspan="2"> </td>
<td width="102"><img src="abc.gif" width="11" height="11" align="absmiddle"> 
<a href="#" 
onMouseOut="MM_showHideLayers('Layer4','','hide')" 
onMouseOver="MM_showHideLayers('Layer4','','show')" class="unnamed2"><font color="#ffffff"> 
关于本站</font></a>
</td>
</tr>
</table>

</td>

</noscript>
</SCRIPT>

  8.鼠标特酷文字

  <SCRIPT LANGUAGE="JavaScript">
<!-- Begin
message = 'JavaScript2000';
FonT = 'Verdana';
ColoR = '223399';
SizE = 3; //1 to 7 only!

var amount = 5, ypos =- 50, xpos = 0, Ay = 0, Ax = 0, By = 0, Bx = 0, Cy = 0, Cx = 0, Dy = 0, Dx = 0, Ey = 0, Ex = 0;
if (document.layers) {
for (i = 0; i < amount; i++) {
document.write('<layer name=nsl'+i+' top=0 left=0><font face='+FonT+' size='+SizE+' color='+ColoR+'>'+message+'</font></layer>');
}
window.captureEvents(Event.MOUSEMOVE);
function nsmouse(evnt) {
xpos = evnt.pageX + 20;
ypos = evnt.pageY + 20;
}
window.onMouseMove = nsmouse;
}
else if (document.all) {
document.write("<div id='outer' style='position:absolute;top:0px;left:0px'>");
document.write("<div style='position:relative'>");
for (i = 0; i < amount; i++) {
document.write('<div id="text"'+i+' style="position:absolute;top:0px;left:0px;width:400px;height:20px"><font face='+FonT+' size='+SizE+' color='+ColoR+'>'+message+'</font></div>')
}
document.write("</div>");
document.write("</div>");
function iemouse() {
ypos = event.y + 20;
xpos = event.x + 20;
}
window.document.onmousemove = iemouse;
}
function makefollow() {
if (document.layers) {
document.layers['nsl'+0].top = ay;
document.layers['nsl'+0].left = ax;
document.layers['nsl'+1].top = by;
document.layers['nsl'+1].left = bx;
document.layers['nsl'+2].top = cy;
document.layers['nsl'+2].left = cx;
document.layers['nsl'+3].top = Dy;
document.layers['nsl'+3].left = Dx;
document.layers['nsl'+4].top = Ey;
document.layers['nsl'+4].left = Ex;
}
else if (document.all) {
outer.style.pixelTop = document.body.scrollTop; 
text[0].style.pixelTop = ay;
text[0].style.pixelLeft = ax;
text[1].style.pixelTop = by;
text[1].style.pixelLeft = bx;
text[2].style.pixelTop = cy;
text[2].style.pixelLeft = cx;
text[3].style.pixelTop = Dy;
text[3].style.pixelLeft = Dx;
text[4].style.pixelTop = Ey;
text[4].style.pixelLeft = Ex;
}
}
function move() {
ey = Ey += (ypos - Ey) * 0.2;
ex = Ex += (xpos - Ex) * 0.2;
dy = Dy += (ey - Dy) * 0.3;
dx = Dx += (ex - Dx) * 0.3;
cy = Cy += (dy - Cy) * 0.4;
cx = Cx += (dx - Cx) * 0.4;
by = By += (cy - By) * 0.5;
bx = Bx += (cx - Bx) * 0.5;
ay = Ay += (by - Ay) * 0.6;
ax = Ax += (bx - Ax) * 0.6;
makefollow();
setTimeout('move()', 10);
}
window.onload=move;
// End -->
</script>

  9.禁用右键并自动导航

  <script language="JavaScript">



if (navigator.appName.indexOf("Internet Explorer") != -1) 

document.onmousedown = noSourceExplorer;



function noSourceExplorer()

{

if (event.button == 2 | event.button == 3)

{

alert("禁止右键...去子文阁!");

location.replace("http://www.wodutom.com/sws66/");

}

}

</script>

      10.禁用鼠标左右键

  <script language="javascript">

function click() {

if (event.button==1) { //改成button==2为禁止右键

alert('子文阁,禁止使用此功能.')

}

}

document.onmousedown=click

</script>

  11.一个特别酷的时钟

  <script language="javascript">

function click() {

if (event.button==1) { //改成button==2为禁止右键

alert('对不起,禁止使用此功能.')

}

}

document.onmousedown=click

</script>

  12.更酷的农历日历

  <script language="JavaScript"> 
<!-- 
var bsYear; 
var bsDate; 
var bsWeek; 
var arrLen=8; //数组长度 
var sValue=0; //当年的秒数 
var dayiy=0; //当年第几天 
var miy=0; //月份的下标 
var iyear=0; //年份标记 
var dayim=0; //当月第几天 
var spd=86400; //每天的秒数 

var year1999="30;29;29;30;29;29;30;29;30;30;30;29"; //354 
var year2000="30;30;29;29;30;29;29;30;29;30;30;29"; //354 
var year2001="30;30;29;30;29;30;29;29;30;29;30;29;30"; //384 
var year2002="30;30;29;30;29;30;29;29;30;29;30;29"; //354 
var year2003="30;30;29;30;30;29;30;29;29;30;29;30"; //355 
var year2004="29;30;29;30;30;29;30;29;30;29;30;29;30"; //384 
var year2005="29;30;29;30;29;30;30;29;30;29;30;29"; //354 
var year2006="30;29;30;29;30;30;29;29;30;30;29;29;30"; 

var month1999="正月;二月;三月;四月;五月;六月;七月;八月;九月;十月;十一月;十二月" 
var month2001="正月;二月;三月;四月;闰四月;五月;六月;七月;八月;九月;十月;十一月;十二月" 
var month2004="正月;二月;闰二月;三月;四月;五月;六月;七月;八月;九月;十月;十一月;十二月" 
var month2006="正月;二月;三月;四月;五月;六月;七月;闰七月;八月;九月;十月;十一月;十二月" 
var Dn="初一;初二;初三;初四;初五;初六;初七;初八;初九;初十;十一;十二;十三;十四;十五;十六;十七;十八;十九;二十;廿一;廿二;廿三;廿四;廿五;廿六;廿七;廿八;廿九;三十"; 

var Ys=new Array(arrLen); 
Ys[0]=919094400;Ys[1]=949680000;Ys[2]=980265600; 
Ys[3]=1013443200;Ys[4]=1044028800;Ys[5]=1074700800; 
Ys[6]=1107878400;Ys[7]=1138464000; 

var Yn=new Array(arrLen); //农历年的名称 
Yn[0]="己卯年";Yn[1]="庚辰年";Yn[2]="辛巳年"; 
Yn[3]="壬午年";Yn[4]="癸未年";Yn[5]="甲申年"; 
Yn[6]="乙酉年";Yn[7]="丙戌年"; 
var D=new Date(); 
var yy=D.getYear(); 
var mm=D.getMonth()+1; 
var dd=D.getDate(); 
var ww=D.getDay(); 
if (ww==0) ww="<font color=RED>星期日"; 
if (ww==1) ww="星期一"; 
if (ww==2) ww="星期二"; 
if (ww==3) ww="星期三"; 
if (ww==4) ww="星期四"; 
if (ww==5) ww="星期五"; 
if (ww==6) ww="<font color=RED>星期六"; 
ww=ww; 
var ss=parseInt(D.getTime() / 1000); 
if (yy<100) yy="19"+yy; 

for (i=0;i<arrLen;i++) 
if (ss>=Ys[i]){ 
iyear=i; 
sValue=ss-Ys[i]; //当年的秒数 

dayiy=parseInt(sValue/spd)+1; //当年的天数 

var dpm=year1999; 
if (iyear==1) dpm=year2000; 
if (iyear==2) dpm=year2001; 
if (iyear==3) dpm=year2002; 
if (iyear==4) dpm=year2003; 
if (iyear==5) dpm=year2004; 
if (iyear==6) dpm=year2005; 
if (iyear==7) dpm=year2006; 
dpm=dpm.split(";"); 

var Mn=month1999; 
if (iyear==2) Mn=month2001; 
if (iyear==5) Mn=month2004; 
if (iyear==7) Mn=month2006; 
Mn=Mn.split(";"); 

var Dn="初一;初二;初三;初四;初五;初六;初七;初八;初九;初十;十一;十二;十三;十四;十五;十六;十七;十八;十九;二十;廿一;廿二;廿三;廿四;廿五;廿六;廿七;廿八;廿九;三十"; 
Dn=Dn.split(";"); 

dayim=dayiy; 

var total=new Array(13); 
total[0]=parseInt(dpm[0]); 
for (i=1;i<dpm.length-1;i++) total[i]=parseInt(dpm[i])+total[i-1]; 
for (i=dpm.length-1;i>0;i--) 
if (dayim>total[i-1]){ 
dayim=dayim-total[i-1]; 
miy=i; 

bsWeek=ww; 
bsDate=yy+"年"+mm+"月"; 
bsDate2=dd; 
bsYear="农历"+Yn[iyear]; 
bsYear2=Mn[miy]+Dn[dayim-1]; 
if (ss>=Ys[7]||ss<Ys[0]) bsYear=Yn[7]; 
function CAL(){ 
document.write("<table border='1' cellspacing='3' width='105' bordercolor='#000000' bgcolor='#FFFFFF' height='110' cellpadding='2'"); 
document.write("<tr><td align='center'><b><font color=#008040>"+bsDate+"</font><br><font face='Arial' size='6' color=#FF8040>"+bsDate2+"</font><br><font color=#008040><span style='FONT-SIZE: 10.5pt'>"); 
document.write(bsWeek+"</span><br>"+"<br></b><font color=#9B4E00>"); 
document.write(bsYear+"<br>"+bsYear2+"</td></tr></table>"); 

//--> 
</script> 
<script language="javascript">CAL();</script> 

  13.Form中的时钟

  <!--步骤一: 请将下面的原代码插入到<body>下面 -->

<script language="JavaScript">



<!--

var timerID = null

var timerRunning = false

function stopclock(){

if(timerRunning)

clearTimeout(timerID)

timerRunning = false

}



function startclock(){

stopclock()

showtime()

}



function showtime(){

var now = new Date()

var hours = now.getHours()

var minutes = now.getMinutes()

var seconds = now.getSeconds()

var timeValue = "" + ((hours > 12) ? hours - 12 : hours)

timeValue += ((minutes < 10) ? ":0" : ":") + minutes

timeValue += ((seconds < 10) ? ":0" : ":") + seconds

if (hours>=6 && hours<=12)

{timeValue += ("上午")}

if(hours>12 && hours<=18) 

{timeValue += ("下午")}

if(hours>18 && hours <=24)

{timeValue +=("晚上")}

if(hours<6) 

{timeValue += ("深夜")}

document.clock.face.value = timeValue 

timerID = setTimeout("showtime()",1000)

timerRunning = true

}





//-->

</script>

<form method="POST" name="clock">

<p> 

<input type="text" name="face" size="11" style="font-size: 9pt">

</p>

</form>

<!--步骤二: 把<body>中的内容改为 -->
<body bgcolor="#fef4d9" onLoad="startclock();">


       14.状态栏显示输入

  <script LANGUAGE="JavaScript">



var text = "在输入栏里您输入什么我就能显示什么!!!";

var total_length = 60; // length of string+spaces



function doShoot(msg) {

var status_message = "";

var assembling = "";

this.status = status_message;

var index = 0;

var location = 0, i;

// now shoot one letter at a time

for(i=0; i < msg.length; i++) { // moves through the message

for(j=total_length-status_message.length; j > -1;j--) { 

// see how many spaces have to be added

assembling = "";

for(var k=0; k < j; k++)

assembling += " ";

assembling += msg.charAt(i);

this.status=status_message +assembling;

}

status_message += assembling;

}

}

</script>





<form name="shooterform" method="get">

<p><input type="text" name="shoot_text" size="20"> <input type="button" name="trigger"

value="请输入" onclick="doShoot(shoot_text.value)"> </p>

</form>

                                       点击下一页