几种不同的javascript移动层
http://ifairy.cn/blog/article.asp?id=256
样式1
- <html>
- <head>
- <title>_xWin</title>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <META NAME="Description" CONTENT="http://www.xuemu.net">
- <style type="text/css">
- <!--
- #main {
- background-color: #CCCCCC;
- height: 600px;
- width: 520px;
- }
- -->
- </style>
- <script language=JScript>
- <!--
- //可以打包为js文件;
- var x0=0,y0=0,x1=0,y1=0;
- var offx=6,offy=6;
- var moveable=false;
- var hover='orange',normal='#336699';//color;
- var index=10000;//z-index;
- //开始拖动;
- function startDrag(obj)
- {
- if(event.button==1)
- {
- //锁定标题栏;
- obj.setCapture();
- //定义对象;
- var win = obj.parentNode;
- var sha = win.nextSibling;
- //记录鼠标和层位置;
- x0 = event.clientX;
- y0 = event.clientY;
- x1 = parseInt(win.style.left);
- y1 = parseInt(win.style.top);
- //记录颜色;
- normal = obj.style.backgroundColor;
- //改变风格;
- obj.style.backgroundColor = hover;
- win.style.borderColor = hover;
- obj.nextSibling.style.color = hover;
- sha.style.left = x1 + offx;
- sha.style.top = y1 + offy;
- moveable = true;
- }
- }
- //拖动;
- function drag(obj)
- {
- if(moveable)
- {
- var win = obj.parentNode;
- var sha = win.nextSibling;
- win.style.left = x1 + event.clientX - x0;
- win.style.top = y1 + event.clientY - y0;
- sha.style.left = parseInt(win.style.left) + offx;
- sha.style.top = parseInt(win.style.top) + offy;
- }
- }
- //停止拖动;
- function stopDrag(obj)
- {
- if(moveable)
- {
- var win = obj.parentNode;
- var sha = win.nextSibling;
- var msg = obj.nextSibling;
- win.style.borderColor = normal;
- obj.style.backgroundColor = normal;
- msg.style.color = normal;
- sha.style.left = obj.parentNode.style.left;
- sha.style.top = obj.parentNode.style.top;
- obj.releaseCapture();
- moveable = false;
- }
- }
- //获得焦点;
- function getFocus(obj)
- {
- if(obj.style.zIndex!=index)
- {
- index = index+2;
- var idx = index;
- obj.style.zIndex=idx;
- obj.nextSibling.style.zIndex=idx-1;
- }
- }
- //最小化;
- function min(obj)
- {
- var win = obj.parentNode.parentNode;
- var sha = win.nextSibling;
- var tit = obj.parentNode;
- var msg = tit.nextSibling;
- var flg = msg.style.display=="none";
- if(flg)
- {
- win.style.height = parseInt(msg.style.height) + parseInt(tit.style.height) + 2*2;
- sha.style.height = win.style.height;
- msg.style.display = "block";
- obj.innerHTML = "0";
- }
- else
- {
- win.style.height = parseInt(tit.style.height) + 2*2;
- sha.style.height = win.style.height;
- obj.innerHTML = "2";
- msg.style.display = "none";
- }
- }
- //创建一个对象;
- function xWin(id,w,h,l,t,tit,msg)
- {
- index = index+2;
- this.id = id;
- this.width = w;
- this.height = h;
- this.left = l;
- this.top = t;
- this.zIndex = index;
- this.title = tit;
- this.message = msg;
- this.obj = null;
- this.bulid = bulid;
- this.bulid();
- }
- //初始化;
- function bulid()
- {
- var str = ""
- + "<div id=xMsg" + this.id + " "
- + "style='"
- + "z-index:" + this.zIndex + ";"
- + "width:" + this.width + ";"
- + "height:" + this.height + ";"
- + "left:" + this.left + ";"
- + "top:" + this.top + ";"
- + "background-color:" + normal + ";"
- + "color:" + normal + ";"
- + "font-size:8pt;"
- + "font-family:Tahoma;"
- + "position:absolute;"
- + "cursor:default;"
- + "border:2px solid " + normal + ";"
- + "' "
- + "onmousedown='getFocus(this)'>"
- + "<div id=Nav_"+(this.id)
- + " style='"
- + "background-color:" + normal + ";"
- + "width:" + (this.width-2*2) + ";"
- + "height:20;"
- + "color:white;"
- + "' "
- + "onmousedown='startDrag(this)' "
- + "onmouseup='stopDrag(this)' "
- + "onmousemove='drag(this)' "
- + "ondblclick='min(this.childNodes[1])'"
- + ">"
- + "<span style='width:" + (this.width-2*12-4) + ";padding-left:3px;'>" + this.title + "</span>"
- + "<span style='width:12;border-width:0px;color:white;font-family:webdings;' onclick='min(Nav_"+(this.id)+".childNodes[1])'>0</span>"
- + "<span style='width:12;border-width:0px;color:white;font-family:webdings;' onclick='ShowHide(\""+this.id+"\",null)'>r</span>"
- + "</div>"
- + "<div id=C_"+(this.id)+" style='"
- + "width:100%;"
- + "height:" + (this.height-20-4) + ";"
- + "background-color:white;"
- + "line-height:14px;"
- + "word-break:break-all;"
- + "padding:3px;"
- + "'>" + this.message + "</div>"
- + "</div>"
- + "<div id=xMsg" + this.id + "bg style='"
- + "width:" + this.width + ";"
- + "height:" + this.height + ";"
- + "top:" + this.top + ";"
- + "left:" + this.left + ";"
- + "z-index:" + (this.zIndex-1) + ";"
- + "position:absolute;"
- + "background-color:black;"
- + "filter:alpha(opacity=40);"
- + "'></div>";
- document.body.insertAdjacentHTML("beforeEnd",str);
-
- }
- //显示隐藏窗口
- function ShowHide(id,dis){
- var bdisplay = (dis==null)?((document.getElementById("xMsg"+id).style.display=="")?"none":""):dis
- document.getElementById("xMsg"+id).style.display = bdisplay;
- document.getElementById("xMsg"+id+"bg").style.display = bdisplay;
- alert (bdisplay);
-
- }
- //-->
- </script>
-
- <script language='JScript'>
- <!--
- function initialize()
- {
- var a = new xWin("1",250,180,10,100,"窗口1","");
- var b = new xWin("2",250,180,10,140,"窗口2","Welcome to visited my personal website:感谢您的关注!");
- var c = new xWin("3",250,180,270,100,"窗口3","Copyright by <a href='#'>Wildwind</a>!");
- var d = new xWin("4",250,180,270,140,"窗口4","Copyright by <a href='#'>Wildwind</a>!");
- //ShowHide("1","none");//隐藏窗口1
- //ShowHide("2","none");//隐藏窗口2
- //ShowHide("3","none");//隐藏窗口3
- min(Nav_1.childNodes[1]);//最小化窗口1
- min(Nav_2.childNodes[1]);//最小化窗口2
- min(Nav_3.childNodes[1]);//最小化窗口3
- min(Nav_4.childNodes[1]);//最小化窗口4
- }
-
- window.onload = initialize;
- </script>
- </head>
- <base target="_blank">
- <body onselectstart='return false' oncontextmenu='return false' >
- <p><span onClick="min(Nav_1.childNodes[1]);">窗口1最小化</span>
- <a onClick="ShowHide('1',null);return false;" href="">窗口1</a>
- <a onClick="ShowHide('2',null);return false;" href="">窗口2</a>
- <a onClick="ShowHide('3',null);return false;" href="">窗口3</a></p>
- <div id="main">main</div>
- <p> </p>
- </body>
- </html>[
样式2
- <html>
- <head>
- <style>
- *{font-size:12px}
- .dragTable{
- font-size:12px;
- border-top:1px solid #3366cc;
- margin-bottom: 10px;
- width:100%;
- background-color:#FFFFFF;
- }
- td{vertical-align:top;}
- .dragTR{
- cursor:move;
- color:#7787cc;
- background-color:#e5eef9;
- height:20px;
- padding-left:5px;
- font-weight:bold;
- }
- #parentTable{
- border-collapse:collapse;
- letter-spacing:25px;
- }
- </style>
- <script defer>
- /****JoeLee************E-MAIL:hktx@163.com****QQ:48293707*****11:09 2006-2-9******/
- var Drag={dragged:false,
- ao:null,
- tdiv:null,
- dragStart:function(){
- Drag.ao=event.srcElement;
- if((Drag.ao.tagName=="TD")||(Drag.ao.tagName=="TR")){
- Drag.ao=Drag.ao.offsetParent;
- Drag.ao.style.zIndex=100;
- }else
- return;
- Drag.dragged=true;
- Drag.tdiv=document.createElement("div");
- Drag.tdiv.innerHTML=Drag.ao.outerHTML;
- Drag.ao.style.border="1px dashed red";
- Drag.tdiv.style.display="block";
- Drag.tdiv.style.position="absolute";
- Drag.tdiv.style.filter="alpha(opacity=70)";
- Drag.tdiv.style.cursor="move";
- Drag.tdiv.style.border="1px solid #000000";
- Drag.tdiv.style.width=Drag.ao.offsetWidth;
- Drag.tdiv.style.height=Drag.ao.offsetHeight;
- Drag.tdiv.style.top=Drag.getInfo(Drag.ao).top;
- Drag.tdiv.style.left=Drag.getInfo(Drag.ao).left;
- document.body.appendChild(Drag.tdiv);
- Drag.lastX=event.clientX;
- Drag.lastY=event.clientY;
- Drag.lastLeft=Drag.tdiv.style.left;
- Drag.lastTop=Drag.tdiv.style.top;
- },
-
- draging:function(){//重要:判断MOUSE的位置
- if(!Drag.dragged||Drag.ao==null)return;
- var tX=event.clientX;
- var tY=event.clientY;
- Drag.tdiv.style.left=parseInt(Drag.lastLeft)+tX-Drag.lastX;
- Drag.tdiv.style.top=parseInt(Drag.lastTop)+tY-Drag.lastY;
- for(var i=0;i<parentTable.cells.length;i++){
- var parentCell=Drag.getInfo(parentTable.cells[i]);
- if(tX>=parentCell.left&&tX<=parentCell.right&&tY>=parentCell.top&&tY<=parentCell.bottom){
- var subTables=parentTable.cells[i].getElementsByTagName("table");
- if(subTables.length==0){
- if(tX>=parentCell.left&&tX<=parentCell.right&&tY>=parentCell.top&&tY<=parentCell.bottom){
- parentTable.cells[i].appendChild(Drag.ao);
- }
- break;
- }
- for(var j=0;j<subTables.length;j++){
- var subTable=Drag.getInfo(subTables[j]);
- if(tX>=subTable.left&&tX<=subTable.right&&tY>=subTable.top&&tY<=subTable.bottom){
- parentTable.cells[i].insertBefore(Drag.ao,subTables[j]);
- break;
- }else{
- parentTable.cells[i].appendChild(Drag.ao);
- }
- }
- }
- }
- }
- ,
- dragEnd:function(){
- if(!Drag.dragged)return;
- Drag.dragged=false;
- Drag.mm=Drag.repos(150,15);
- Drag.ao.style.borderWidth="0px";
- Drag.ao.style.borderTop="1px solid #3366cc";
- Drag.tdiv.style.borderWidth="0px";
- Drag.ao.style.zIndex=1;
- },
- getInfo:function(o){//取得坐标
- var to=new Object();
- to.left=to.right=to.top=to.bottom=0;
- var twidth=o.offsetWidth;
- var theight=o.offsetHeight;
- while(o!=document.body){
- to.left+=o.offsetLeft;
- to.top+=o.offsetTop;
- o=o.offsetParent;
- }
- to.right=to.left+twidth;
- to.bottom=to.top+theight;
- return to;
- },
- repos:function(aa,ab){
- var f=Drag.tdiv.filters.alpha.opacity;
- var tl=parseInt(Drag.getInfo(Drag.tdiv).left);
- var tt=parseInt(Drag.getInfo(Drag.tdiv).top);
- var kl=(tl-Drag.getInfo(Drag.ao).left)/ab;
- var kt=(tt-Drag.getInfo(Drag.ao).top)/ab;
- var kf=f/ab;
- return setInterval(function(){if(ab<1){
- clearInterval(Drag.mm);
- Drag.tdiv.removeNode(true);
- Drag.ao=null;
- return;
- }
- ab--;
- tl-=kl;
- tt-=kt;
- f-=kf;
- Drag.tdiv.style.left=parseInt(tl)+"px";
- Drag.tdiv.style.top=parseInt(tt)+"px";
- Drag.tdiv.filters.alpha.opacity=f;
- }
- ,aa/ab)
- },
- inint:function(){//初始化
- for(var i=0;i<parentTable.cells.length;i++){
- var subTables=parentTable.cells[i].getElementsByTagName("table");
- for(var j=0;j<subTables.length;j++){
- if(subTables[j].className!="dragTable")break;
- subTables[j].rows[0].className="dragTR";
- subTables[j].rows[0].attachEvent("onmousedown",Drag.dragStart);
- }
- }
- document.onmousemove=Drag.draging;
- document.onmouseup=Drag.dragEnd;
- }
- //end of Object Drag
- }
- Drag.inint();
-
- function _show(str){
- var w=window.open('','');
- var d=w.document;
- d.open();
- str=str.replace(/=(?!")(.*?)(?!")( |>)/g,"=\"$1\"$2");
- str=str.replace(/(<)(.*?)(>)/g,"<span style='color:red;'><$2></span><br />");
- str=str.replace(/\r/g,"<br />\n");
- d.write(str);
- }
- </script>
- </head>
- <body>
- <table border="0" cellpadding="0" cellspacing="10" width="100%" height=500 id="parentTable">
- <tr >
- <td width="25%" valgin="top">
- <table border=0 class="dragTable" cellspacing="0">
- <tr>
- <td><b>GMAIL</b></td>
- </tr>
- <tr>
- <td>暂时无法显示GMAIL内容</td>
- <tr>
- </table><table border=0 class="dragTable" cellspacing="0">
- <tr>
- <td>新浪体育</td>
- </tr>
- <tr>
- <td>解剖威队独门利器FW28 2万转引擎匹配超级变速器颁奖:辛吉斯欣喜能以冠军起步<br/> 印度搭档创下纪录法新社前瞻冬奥短道速滑:中韩唱主角 美加施冷箭</td>
- <tr>
- </table>
- <table border=0 class="dragTable" cellspacing="0">
- <tr>
- <td>焦点</td>
- </tr>
- <tr>
- <td>京广线中断4小时20临客返汉晚点 中国新闻网-湖北分社 - 所有 235 相关报道 »哈马斯已有总理人选
- 解放日报报业集团 - 所有 489 相关报道 »陈水扁是两岸关系麻烦制造者 武汉晨报 - 所有 179 相关报道 »</td>
- <tr>
- </table>
- </td>
- <td width="25%">
- <table border=0 class="dragTable" cellspacing="0">
- <tr>
- <td>中关村在线</td>
- </tr>
- <tr>
- <td>新年行情速递 双敏板卡低价推荐 终于等到了,映泰6600GT一降降一百 罗技G15游戏键盘热力促销,代购价仅529元 </td>
- <tr>
- </table></td>
- <td width="25%">
- <table border=0 class="dragTable" cellspacing="0">
- <tr>
- <td>网易商业</td>
- </tr>
- <tr>
- <td>上海GDP增幅去年出现回落应对反倾销 中国鞋企联手对抗欧盟尹家绪操盘南方汽车 长安谋求曲线整体境外上市</td>
- <tr>
- </table> <table border=0 class="dragTable" cellspacing="0">
- <tr>
- <td>黑可天下</td>
- </tr>
- <tr>
- <td>上海GDP增幅去年出现回落应对反倾销 中国鞋企联手对抗欧盟尹家绪操盘南方汽车 长安谋求曲线整体境外上市</td>
- <tr>
- </table>
- </td>
- </tr>
- </table>
- <input type="button" value="SHOW" onClick="_show(document.documentElement.innerHTML)" />
- </body>
- </html>
样式3
- <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="content-type" content="text/html; charset=gb2312" />
- <meta http-equiv="content-language" content="zh-cn" />
- <meta name="author" content="forfor" />
- <meta name="keywords" content="" />
- <title>Demo</title>
- <script type="text/javascript">
- <!--
- var IE=false,FF=false,W=window,D=document,H,B,GET="getElementsByTagName",GEI="getElementById",qq=0;
-
- function fold(){
- var e;
- e=fixE(e);
- if(e)element=fixElement(e);
- element=element.parentNode.parentNode;
- element.className=element.className.indexOf("hide")>0?"module":"module hide";
- }
-
- var Drag={
- draging : false,
- x : 0,
- y : 0,
- element : null,
- fDiv : null,
- ghost : null,
- addEvent : function(){var a=D[GET]("li");for(var i=a.length-1;i>-1;i--)if(a[i].className=="module")a[i].onmousedown=Drag.dragStart;},
- ix:2,iy:7,
- ox:6,oy:7,
- fx:6,fy:6,
-
- dragStart : function (e){
- if(Drag.draging)return;
- var e;
- e=fixE(e);
- if(e)element=fixElement(e);
-
- /*********
- var k,s="";
- for(k in element)s+=k+" : "+element[k]+"<br/>";
- D.getElementById("bbb").innerHTML=s;
- **********/
- D.getElementById("aaa").innerHTML=element.parentNode.offsetTop+ ","+element.parentNode.offsetHeight;
- //测试
-
- if(element.className!="title")return;
- element=element.parentNode;
- Drag.element=element;
- //以上获得当前移动的模块
-
- Drag.x=e.layerX?e.layerX+Drag.fx:(IE?e.x+Drag.ix:e.offsetX+Drag.ox);
- Drag.y=e.layerY?e.layerY+Drag.fy:(IE?e.y+Drag.iy:e.offsetY+Drag.oy);
- //鼠标相对于模块的位置
-
- Drop.measure();
- if(e.layerX){Drag.floatIt(e);Drag.drag(e);}//fix FF
- B.style.cursor="move";
- D.onmousemove=Drag.drag;
- D.ondragstart=function(){window.event.returnValue = false;}
- D.onselectstart=function(){window.event.returnValue = false;};
- D.onselect=function(){return false};
- D.onmouseup=element.onmouseup=Drag.dragEnd;
- element.onmousedown=null;
- },
- drag : function (e){
- var e;
- e=fixE(e);
- if(!Drag.fDiv)Drag.floatIt(e);//for IE & Opera
- var x=e.clientX,y=e.clientY;
- Drag.fDiv.style.top=y+H.scrollTop-Drag.y+"px";
- Drag.fDiv.style.left=x+H.scrollLeft-Drag.x+"px";
- Drop.drop(x,y);
- //statu(e);
- },
- dragEnd : function (e){
- B.style.cursor="";
- D.ondragstart=D.onmousemove=D.onselectstart=D.onselect=D.onmouseup=null;
- Drag.element.onmousedown=Drag.dragStart;
- if(!Drag.draging)return;
- Drag.ghost.parentNode.insertBefore(Drag.element,Drag.ghost);
- Drag.ghost.parentNode.removeChild(Drag.ghost);
- B.removeChild(Drag.fDiv);
- Drag.fDiv=null;
- Drag.draging=false;
- Drop.init(D[GEI]("container"));
- },
- floatIt : function(e){
- var e,element=Drag.element;
- var ghost=D.createElement("LI");
- Drag.ghost=ghost;
- ghost.className="module ghost";
- ghost.style.height=element.offsetHeight-2+"px";
- element.parentNode.insertBefore(ghost,element);
- //创建模块占位框
-
- var fDiv=D.createElement("UL");
- Drag.fDiv=fDiv;
- fDiv.className="float";
- B.appendChild(fDiv);
- fDiv.style.width=ghost.parentNode.offsetWidth+"px";
- fDiv.appendChild(element);
- //创建容纳模块的浮动层
-
- Drag.draging=true;
- }
- }
-
- var Drop={
- root : null,
- index : null,
- column : null,
- init : function(it){
- if(!it)return;
- Drop.root=it;
-
- it.firstItem=it.lastItem=null;
- var a=it[GET]("ul");
- for(var i=0;i<a.length;i++){
- if(a[i].className!="column")continue;
- if(it.firstItem==null){
- it.firstItem=a[i];
- a[i].previousItem=null;
- }else{
- a[i].previousItem=a[i-1];
- a[i-1].nextItem=a[i];
- }
- a[i].nextItem=null;
- it.lastItem=a[i];
- a[i].index=i;
-
- a[i].firstItem=a[i].lastItem=null;
- var b=a[i][GET]("li");
- for(var j=0;j<b.length;j++){
- if(b[j].className.indexOf("module")==-1)continue;
- if(a[i].firstItem==null){
- a[i].firstItem=b[j];
- b[j].previousItem=null;
- }else{
- b[j].previousItem=b[j-1];
- b[j-1].nextItem=b[j];
- }
- b[j].nextItem=null;
- a[i].lastItem=b[j];
- b[j].index=i+","+j;
- }
- }
- },
- measure : function(){
- if(!Drop.root)return;
- var currentColumn=Drop.root.firstItem;
- while(currentColumn){
- var currentModule=currentColumn.firstItem;
- while(currentModule){
- currentModule.minY=currentModule.offsetTop;
- currentModule.maxY=currentModule.minY+currentModule.offsetHeight;
- currentModule=currentModule.nextItem;
- }
- currentColumn.minX=currentColumn.offsetLeft;
- currentColumn.maxX=currentColumn.minX+currentColumn.offsetWidth;
- currentColumn=currentColumn.nextItem;
- }
- Drop.index=Drag.element.index;
- },
- drop : function(x,y){
- if(!Drop.root)return;
- var x,y,currentColumn=Drop.root.firstItem;
- while(x>currentColumn.maxX)if(currentColumn.nextItem)currentColumn=currentColumn.nextItem;else break;
- var currentModule=currentColumn.lastItem;
- if(currentModule)while(y<currentModule.maxY){
- if(y>currentModule.minY-12){
- if(Drop.index==currentModule.index)return;
- Drop.index=currentModule.index;
- if(currentModule.index==Drag.element.index){if(currentModule.nextItem)currentModule=currentModule.nextItem;else break;}
- currentColumn.insertBefore(Drag.ghost,currentModule);
- Drop.column=null;
- window.status=qq++;
- return;
- }else if(currentModule.previousItem)currentModule=currentModule.previousItem;else return;
- }
- if(Drop.column==currentColumn.index)return;
- currentColumn.appendChild(Drag.ghost);
- Drop.index=0;
- Drop.column=currentColumn.index;
- window.status=qq++;
- }
- }
-
- var webNote={
- obj : null,
- canEdit : function(e){
- var e,element;
- e=fixE(e);
- element=fixElement(e);
- if(element.className!='webNote')return;
- if(typeof element.contentEditable!="undefined"){
- element.contentEditable=true;
- element.style.borderColor='red';
- element.focus();
- webNote.obj=element;
- }
- },
- cannotEdit : function(){
- if(!webNote.obj)return;
- if(typeof webNote.obj.contentEditable!="undefined"){
- webNote.obj.style.borderColor='#ffffe0';
- webNote.obj.contentEditable=false;
- webNote.obj=null;
- }
- }
- }
-
- function fixE(e){var e;e=e?e:(window.event?window.event:null);return e}
-
- function fixElement(e){var e;return e.target?(e.target.nodeType==3?e.target.parentNode:e.target):e.srcElement;}
-
-
- onload=function(){
- B=D[GET]("body")[0];
- H=D[GET]("html")[0];
- Drop.init(D[GEI]("container"));
- Drag.addEvent();
- }
-
- function statu(e){
- var e,element;
- element=fixElement(e);
- var aa=D.getElementById("aaa");
- aa.innerHTML="e.xy:("+e.x+","+e.y+")<br/>e.offsetXY:("+e.offsetX+","+e.offsetY+")<br/>e.clientXY:("+e.clientX+","+e.clientY+")<br/>element.offsetLeftTop:("+element.offsetLeft+","+element.offsetTop+")<br/>e.layerXY:("+e.layerX+","+e.layerY+")";
- }
-
- //-->
- </script>
- <style type="text/css">
- body,table,td,th,input,textarea,button,select{font:13px/16px Verdana,"宋体",sans-serif;}
- table{border-collapse:collapse;}
- p{margin:0px;}
-
- .container{margin:8px;}
- .column{width:33%;margin:0px;padding:0px;float:left;overflow:hidden;}
- .module{margin:5px;padding:0px;border:1px solid #dcd;position:relative;background-color:white;list-style:none;}
- .title{background-color:#edf;padding:1px 0px;width:100%;overflow:hidden;cursor:move;z-index:0;font-weight:bold;}
- .cont{padding:3px;overflow:hidden;}
- .hide .cont{display:none;}
-
- .pageTitle{font-weight:bold;text-align:center;}
- input.pageTitle{display:none;border:0px;padding:0px;width:100%;}
- .webNote{background-color:#ffffe0;border:1px solid #ffffe0;}
- textarea.webNote{display:none;overflow:hidden;padding:0px;border:0px;padding:0px;}
-
- .ghost{border:1px dashed red;}
- .float{position:absolute;z-index:100;margin:0px;padding:0px;overflow:hidden;list-style:none;-moz-opacity:.75;filter:Alpha(opacity=75);}
- </style>
- <!--[if IE]>
- <script type="text/javascript">
- IE=true;
- </script>
- <style type="text/css">
- input.pageTitle{margin:-1px;}
- </style>
- <![endif]-->
- <![if !IE]><![endif]>
- </head>
- <body>
- <center><span class="pageTitle" onclick="with(this.nextSibling){value=this.innerHTML;style.display='block';focus()};this.style.display='none';">You can input a topic here!</span><input class="pageTitle" onblur="with(this.previousSibling){D.title=innerHTML=this.value?this.value:'Demo';style.display='block';};this.style.display='none'" /></center>
-
- <div class="container" id="container">
- <ul class="column">
- <li class="module">
- <div class="title"><span onclick="fold()">+</span> Coodinate</div>
- <div class="cont" id="aaa">content</div>
- </li>
- <li class="module">
- <div class="title"><span onclick="fold()">+</span> contentEditable</div>
- <div class="cont" onclick="alert('this.contentEditable:'+this.contentEditable)">click here</div>
- </li>
- <li class="module">
- <div class="title"><span onclick="fold()">+</span> long long ago</div>
- <div class="cont">有形者 生于无形 无能生有 有归于无<br/>是以 凡所有所相 皆是虚妄<br/>若是能见诸相非相 当知虚非真虚<br/>有生之气 有形之状 尽是幻也<br/>造物之所始 阴阳之所变者 谓之生 谓之死<br/>穷数达变 因形移易者 谓之化 谓之幻</br>了悟有无 参透虚实 自然遨游天地宇宙 无所阻碍<br/>是谓大幻之道</div>
- </li>
- </ul>
- <ul class="column">
- <li class="module">
- <div class="title"><span onclick="fold()">+</span> this.parentNode</div>
- <div class="cont"><button onclick="alert(this.parentNode.parentNode.parentNode.innerHTML)">parentNode</button></div>
- </li>
- <li class="module">
- <div class="title"><span onclick="fold()">+</span> webNote</div>
- <div class="cont"><div class="webNote" onblur="webNote.cannotEdit()" onclick="webNote.canEdit(event)">You can note something here.<br/><br/>从前有座山<br/>山里有座庙</br>庙里有个老和尚讲故事</div><textarea class="webNote"></textarea></div>
- </li>
- <li class="module">
- <div class="title"><span onclick="fold()">+</span> Google</div>
- <div class="cont"><center><a href="http://www.google.com" style="font:bold 31px/2 Arial;">Gooooooogle</a></center></div>
- </li>
- </ul>
- <ul class="column">
- <li class="module">
- <div class="title"><span onclick="fold()">+</span> pia~~</div>
- <div class="cont">十里平湖霜满天<br/>寸寸青丝愁华年<br/>对月形单忘相护<br/>只羡鸳鸯不羡仙</div>
- </li>
- <li class="module">
- <div class="title"><span onclick="fold()">+</span> biu~~</div>
- <div class="cont">您好!<br/>主人不在,您可以在biu~的一声后留言<br/>biu~~</div>
- </li>
- <li class="module">
- <div class="title"><span onclick="fold()">+</span> 无话可说</div>
- <div class="cont" id="bbb">吃葡萄不吐葡萄皮<br/>不吃葡萄倒吐葡萄皮<br/>(字数不够,再吃一遍......)</div>
- </li>
- </ul>
- </div>
-
- <div style="font-size:10px;line-height:14px;clear:both;margin:6px 3%;text-align:center;border:1px solid #eee;">©2006 forfor</div>
- </body>
- </html>
posted on 2007-04-10 21:09
流浪汗 阅读(2778)
评论(1) 编辑 收藏 所属分类:
收藏夹