asp学习网: 首页 >> 表单 >> 非常不错的一个文本框效果 带加密和解密 以及另存功能等

非常不错的一个文本框效果 带加密和解密 以及另存功能等

<html>
<head>
<style type="text/css">
INPUT {
    filter:alpha(opacity=80); border: 1 solid #000000
  }
</style>
<title>超酷文本框!!!
</title></head>

<body background="http://bbs.51js.com/images/standard/51js.gif">
<SCRIPT language=JavaScript>
var i=0;
var ie=(document.all)?1:0;
var ns=(document.layers)?1:0;
function generate() /* Generation of "Compilation" */
{
code = document.pad.text.value;
if (code)
{
document.pad.text.value='Compiling...Please wait!';
setTimeout("compile()",500);
}
else alert('First enter something to compile and then press CompileIt')
}
function compile() /* The "Compilation" */
{
document.pad.text.value='';
compilation=escape(code);
document.pad.text.value="<script>\n<!--\ndocument.write(unescape(\""+compilation+"\"));\n//-->\n<\/script>";
i++;
alert("Page compiled "+i+" times!");
}
function selectCode() /* Selecting "Compilation" for Copying */
{
if(document.pad.text.value.length>0)
{
document.pad.text.focus();
document.pad.text.select();
}
else alert('Nothing for be selected!')
}
function preview() /* Preview for the "Compilation" */
{
if(document.pad.text.value.length>0)
{
pr=window.open("","Preview","scrollbars=1,menubar=1,status=1,left=10,top=10");
pr.document.write(document.pad.text.value);
}
else alert('Nothing for be previewed!')
}
function uncompile() /* Decompiling a "Compilation" */
{
if (document.pad.text.value.length>0)
{
source=unescape(document.pad.text.value);
document.pad.text.value=""+source+"";
}
else alert('You need compiled code to uncompile it!')
}
// -->
</SCRIPT>
<script>
function tp()
{pad.text.focus()
document.execCommand("Paste")}
function savetxt() {
var newwin=window.open('about:blank','','top=10000');
newwin.document.write(document.pad.text.value);
newwin.document.execCommand('saveas','','c_d.htm')
newwin.window.close();}
</script>
<FORM method=post name=pad align="center">
<p align="center"><TEXTAREA cols=120 name=text rows=22 style="filter:alpha(opacity=80)">
<html>
<STYLE>.navPoint {
COLOR: white; CURSOR: hand; FONT-FAMILY: Webdings; FONT-SIZE: 9pt
}
P {
FONT-SIZE: 9pt
}
</STYLE>
</HEAD>
<BODY scroll=no style="MARGIN: 0px" text="black" vlink="black" link="black" alink="black">
<SCRIPT>

function showitem(id,name)
{
var idname=new Array()
idname[0]="gl1.htm"
idname[1]="gl2.htm"
idname[2]="gl3.htm"
idname[3]="gl4.htm"
idname[4]="gl5.htm"
idname[5]="gl6.htm"
idname[6]="poems/shipwrech.htm"
idname[7]="poems/peasant.htm"
idname[8]="poems/destrman.htm"
idname[9]="poems/Chester_Beatty.htm "
idname[10]="poems/Ptah_Hotep.htm"
idname[11]="poems/lovepoem.htm"
idname[12]="poems/niluohesong.htm"
idname[13]="poems/adunsong.htm"
idname[14]="poems/lasong.htm"
idname[15]="poems/tut.htm"
return ("<span class=smallFont><a target='main1' href="+idname[id-1]+">"+name+"</a></span><br>")
}
function switchoutlookBar(number)
{ var i = outlookbar.opentitle;
outlookbar.opentitle=number;
var id1,id2,id1b,id2b
if (number!=i && outlooksmoothstat==0){
if (number!=-1)
{
if (i==-1)
{
id2="blankdiv";
id2b="blankdiv";}
else{
id2="outlookdiv"+i;
id2b="outlookdivin"+i;
document.all("outlooktitle"+i).style.border="1px solid navy";
document.all("outlooktitle"+i).style.background="#ffb600";
document.all("outlooktitle"+i).style.color="white";
document.all("outlooktitle"+i).style.textalign="center";
}
id1="outlookdiv"+number
id1b="outlookdivin"+number
document.all("outlooktitle"+number).style.border="1px solid white";
document.all("outlooktitle"+number).style.background="#FBE499";
document.all("outlooktitle"+number).style.color="#ffb600";
document.all("outlooktitle"+number).style.textalign="center";
smoothout(id1,id2,id1b,id2b,0);
}
else
{
document.all("blankdiv").style.display="";
document.all("blankdiv").sryle.height="100%";
document.all("outlookdiv"+i).style.display="none";
document.all("outlookdiv"+i).style.height="0%";
document.all("outlooktitle"+i).style.border="1px solid navy";
document.all("outlooktitle"+i).style.background="#ffb600";
document.all("outlooktitle"+i).style.color="white";
document.all("outlooktitle"+i).style.textalign="center";
}
}

}

function smoothout(id1,id2,id1b,id2b,stat)
{
if(stat==0){
tempinnertext1=document.all(id1b).innerHTML;
tempinnertext2=document.all(id2b).innerHTML;
document.all(id1b).innerHTML="";
document.all(id2b).innerHTML="";
outlooksmoothstat=1;
document.all(id1b).style.overflow="hidden";
document.all(id2b).style.overflow="hidden";
document.all(id1).style.height="0%";
document.all(id1).style.display="";
setTimeout("smoothout('"+id1+"','"+id2+"','"+id1b+"','"+id2b+"',"+outlookbar.inc+")",outlookbar.timedalay);
}
else
{
stat+=outlookbar.inc;
if (stat>100)
stat=100;
document.all(id1).style.height=stat+"%";
document.all(id2).style.height=(100-stat)+"%";
if (stat<100)
setTimeout("smoothout('"+id1+"','"+id2+"','"+id1b+"','"+id2b+"',"+stat+")",outlookbar.timedalay);
else
{
document.all(id1b).innerHTML=tempinnertext1;
document.all(id2b).innerHTML=tempinnertext2;
outlooksmoothstat=0;
document.all(id1b).style.overflow="auto";
document.all(id2).style.display="none";
}
}
}

function getOutLine()
{
outline="<table "+outlookbar.otherclass+">";
for (i=0;i<(outlookbar.titlelist.length);i++)
{
outline+="<tr><td name=outlooktitle"+i+" id=outlooktitle"+i+" ";
if (i!=outlookbar.opentitle)
outline+=" nowrap align=center style='cursor:hand;background-color:#ffb600;color:white;height:5;border:1 solid navy' ";
else
outline+=" nowrap align=center style='cursor:hand;background-color:#FBE499;color:#ffb600;height:5;border:1 solid white' ";
outline+=outlookbar.titlelist[i].otherclass
outline+=" onclick='switchoutlookBar("+i+")'><span class=smallFont><b>";
outline+=outlookbar.titlelist[i].title+"</b></span></td></tr>";
outline+="<tr><td name=outlookdiv"+i+" valign=top align=center id=outlookdiv"+i+" style='width:100%"
if (i!=outlookbar.opentitle)
outline+=";display:none;height:0%;";
else
outline+=";display:;height:100%;";
outline+="'><div name=outlookdivin"+i+" id=outlookdivin"+i+" style='overflow:auto;width:100%;height:100%'>";
for (j=0;j<outlookbar.itemlist[i].length;j++)
outline+=showitem(outlookbar.itemlist[i][j].key,outlookbar.itemlist[i][j].title);
outline+="</div></td></tr>"
}
outline+="<tr><td name=blankdiv valign=top align=center id=blankdiv style='height:100%;width:100%:"
if (outlookbar.opentitle!=-1)
outline+=";display:none;";
else
outline+=";display:;";
outline+="'><div style='overflow:auto;width:100%;height:100%'>";
outline+="</div></td></tr>"

outline+="</table>"
return outline

}

function show()
{
var outline;
outline="<div id=outLookBarDiv name=outLookBarDiv style='width=100%;height:100%'>"
outline+=outlookbar.getOutLine();
outline+="</div>"
document.write(outline);
//document.all("outLookBarDiv").innerHTML=
}

function theitem(intitle,instate,inkey)
{
this.state=instate;
this.otherclass=" nowrap ";
this.key=inkey;
this.title=intitle;
}

function addtitle(intitle)
{
outlookbar.itemlist[outlookbar.titlelist.length]=new Array();
outlookbar.titlelist[outlookbar.titlelist.length]=new theitem(intitle,1,0);
/* if (outlookbar.titlelist.length != (outlookbar.starttitle+1))
outlookbar.titlelist[outlookbar.titlelist.length-1].otherclass=" nowrap align=center style='cursor:hand;background-color:#ffb600;color:white;height:5;border:1 solid navy' ";
else
outlookbar.titlelist[outlookbar.titlelist.length-1].otherclass=" nowrap align=center style='cursor:hand;background-color:#FBE499;color:#ffb600;height:5;border:1 solid white' ";
*/ return(outlookbar.titlelist.length-1);
}

function additem(intitle,parentid,inkey)
{
if (parentid>=0 && parentid<=outlookbar.titlelist.length)
{
outlookbar.itemlist[parentid][outlookbar.itemlist[parentid].length]=new theitem(intitle,2,inkey);
outlookbar.itemlist[parentid][outlookbar.itemlist[parentid].length-1].otherclass=" nowrap align=left style='backgroundColor:blue;height:5' ";
return(outlookbar.itemlist[parentid].length-1);
}
else
additem=-1;
}

function outlook()
{
this.titlelist=new Array();
this.itemlist=new Array();
this.divstyle="style='height:100%;width:100%;overflow:auto' align=center";
this.otherclass="border=0 cellspacing='0' cellpadding='0' style='height:100%;width:100%'valign=middle align=center ";
this.addtitle=addtitle;
this.additem=additem;
this.starttitle=-1;
this.show=show;
this.getOutLine=getOutLine;
this.opentitle=this.starttitle;
this.reflesh=outreflesh;
this.timedelay=50;
this.inc=10;

}

function outreflesh()
{
document.all("outLookBarDiv").innerHTML=outlookbar.getOutLine();
}

function locatefold(foldname)
{
for (var i=0;i<outlookbar.titlelist.length;i++)
if(foldname==outlookbar.titlelist[i].title)
{
outlookbar.starttitle=i;
outlookbar.opentitle=i;
}

}

var outlookbar=new outlook();
var tempinnertext1,tempinnertext2,outlooksmoothstat
outlooksmoothstat = 0;


</SCRIPT>
<script language="JavaScript">
var t;
t=outlookbar.addtitle('www.aspxuexi.com')

outlookbar.additem('asp学习网,t,1)

t=outlookbar.addtitle('aspxuexi.com)

outlookbar.additem('概论',t,2)

t=outlookbar.addtitle('教谕文学')

outlookbar.additem('概论',t,3)
outlookbar.additem('Ptah_Hotep教谕',t,11)

t=outlookbar.addtitle('传记文学')

outlookbar.additem('概论',t,4)
outlookbar.additem('图特摩斯三世年代记',t,16)

t=outlookbar.addtitle('散文故事')

outlookbar.additem('概论',t,5)
outlookbar.additem('人类的毁灭',t,9)
outlookbar.additem('www.aspxuexi.com',t,7)
outlookbar.additem('能说善辩的农夫',t,8)

t=outlookbar.addtitle('诗歌')

outlookbar.additem('概论',t,6)
outlookbar.additem('情诗',t,12)
outlookbar.additem('拉的颂歌',t,15)
outlookbar.additem('阿顿颂歌',t,14)
outlookbar.additem('尼罗河颂歌',t,13)
outlookbar.additem('切斯特·贝蒂斯纸草',t,10)

t=outlookbar.addtitle('合拢所有')
</script>
<div align="left"
<TABLE border=3 cellPadding=1 cellSpacing=1 bgcolor="#bbc8c0"
width="100%" height="100%" vspace="0" hspace="0">
<TBODY>
<TR>
<TD align=middle id=outLookBarShow vAlign=top
name="outLookBarShow">
<TABLE border=3 cellPadding=2 cellSpacing=2 bgcolor="#bbc8c0" style="HEIGHT: 100%; WIDTH: 140px" vspace="0" hspace="0">
<TBODY>
<TR>
<TD align=middle id=outLookBarShow style="HEIGHT: 100%" vAlign=top
name="outLookBarShow" height="366">
<SCRIPT>
outlookbar.show()
</SCRIPT>

</TD></TR>
<tr>
<td align="center"><font size="3" color="red">
<b><a href="right.htm" target="main1">注 意</a></b></font>
</td>
</tr>
</TBODY></TABLE>
</div>

</BODY></HTML></TEXTAREA><BR><p align="center">

<INPUT name=view onclick=preview() type=button value=预览(ALT+W) accesskey=W>
<INPUT name=select onclick=selectCode() type=button value=全选(ALT+A) accesskey=A>
<INPUT type="button" onclick=text.focus(),document.execCommand("Cut") value=剪切(ALT+X) accesskey=X>
<INPUT type="button" onclick=text.focus(),document.execCommand("Copy") value=复制(ALT+C) accesskey=C>
<INPUT name=select onclick=tp() type=button value=粘贴(ALT+V) accesskey=V>
<INPUT type="button" onclick="text.value=text.value.toUpperCase()" value=大写(ALT+D) accesskey=D>
<INPUT type="button" onclick="text.value=text.value.toLowerCase()" value=小写(ALT+B) accesskey=B>
<INPUT type="button" onclick="text.value=escape(text.value)" value=Ascii(ALT+T) accesskey=T>
<INPUT type="button" onclick="text.value=unescape(text.value)" value=UnAscii(ALT+N) accesskey=N>
<INPUT name=compileIt onclick=generate() type=button value=加密(ALT+J) accesskey=J>
<INPUT name=retur onclick=uncompile() type=button value=解密(ALT+L) accesskey=L>
<INPUT name=retur onclick=savetxt() type=button value=保存(ALT+S) accesskey=S>
<INPUT name=clear type=reset value=还原(ALT+U) accesskey=U></FORM></body></html> from:asp学习网/title:非常不错的一个文本框效果 带加密和解密 以及另存功能等/ time:2007-3-3 14:28:34

本文主题非常不错的一个文本框效果 带加密和解密 以及另存功能等

asp教程 ©2006-2007 aspxuexi.com | 关于站点 | 版权隐私 | 站内搜索
复制或者翻版 请于夜间进行