<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('
非常不错的一个文本框效果 带加密和解密 以及另存功能等
原创文章如转载,请注明:转载自悠悠博客 [ http://www.ajaxstu.com/ ]
相关文章:
- 各浏览器里默认的表单控件(图)(2007-11-19 1:30:10)
- onsubmit="return false;"(2007-10-25 4:0:0)
- 限制TextArea区的文字输入数量(2007-9-26 6:30:36)
- label标签的使用(2007-9-25 1:52:18)
- 表单元件在说什么?---分析表单元件的语义(2007-9-16 8:13:39)
- 标准化表单设计(form)实例(2007-9-14 11:9:4)
- 判断checkbox是否至少有选择一项(2007-9-12 8:42:1)
- HTML元素 - select(2007-9-6 6:16:28)
- HTML元素 - textarea(2007-8-21 2:27:35)
- 向文本框输出数据的函数(2007-8-9 2:15:49)
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。
