mjc 发表于 2007-4-27 11:20:59

***技巧类***可移动与隐藏的图层

把下列代码加到网页的<body></body>标签之间 从google下载我的照片管理软件
特效版权归特效本人所有,未经同意不得转载!
<script language="javascript1.2"> <!-- begin var dragswitch=0 var nsx var nsy var nstemp function drag_dropns(name){ temp=eval(name) temp.captureevents(event.mousedown | event.mouseup) temp.onmousedown=gons temp.onmousemove=dragns temp.onmouseup=stopns } function gons(e){ temp.captureevents(event.mousemove) nsx=e.x nsy=e.y } function dragns(e){ if (dragswitch==1){ temp.moveby(e.x-nsx,e.y-nsy) return false } } function stopns(){ temp.releaseevents(event.mousemove) } //drag drop function for ie 4+//// ///////////////////////////////// var dragapproved=false function drag_dropie(){ if (dragapproved==true){ document.all.showimage.style.pixelleft=tempx+event.clientx-iex document.all.showimage.style.pixeltop=tempy+event.clienty-iey return false } } function initializedragie(){ iex=event.clientx iey=event.clienty tempx=showimage.style.pixelleft tempy=showimage.style.pixeltop dragapproved=true document.onmousemove=drag_dropie } if (document.all){ document.onmouseup=new function("dragapproved=false") } ////drag drop functions end here////// function hidebox(){ if (document.all) showimage.style.visibility="hidden" else if (document.layers) document.showimage.visibility="hide" } // end --> </script> <div id="showimage" style="position:absolute;left:150;top:90; width: 400px; height: 89px"> <!-- 层位置 --> <table border="0" width="400" bgcolor="#0000ff" cellspacing="0" cellpadding="1" height="164"> <!-- 边框颜色及宽度 --> <tr> <td width="100%"> <table border="0" width="399" cellspacing="0" cellpadding="0" height="175"> <tr> <td onmousedown="initializedragie()" style="cursor:move" width="94%" height="8"> <layer width="385" onmouseover="dragswitch=1;drag_dropns(showimage)" onmouseout="dragswitch=0" height="17" left="15" top="18"> <!-- 标题开始 --> <font size="2" color="#ffffff">数据查询</font> <!-- 结束 --> </layer>   </td> <td width="6%" height="8"> <a href="#" onclick="hidebox();return false"> <img src="close_up.gif" alt="關閉" align="absmiddle" border=0 width="11" height="11">http://code.ik8.com/html/close_up.gif</a></td> </tr><tr> <td bgcolor="#ffffff" style="padding:4px" colspan="2"> <!-- 层颜色设定 --> <!-- 内容开始 --> <font size="2"> e-mail <br> guestbook <br>

            <a href="http://www.aspease.com">http://www.aspease.com</a> </font>
            <!-- 内容结束 -->
            </td>
          </tr></table></td></tr></table> </div>
      










--------------------------------------

拥有三人行论坛管理系列软件,一个人就可以管理一个论坛的更新维护。还能使您的论坛有千人在线的真实火暴效果,让您不在为论坛因没有人气而留不住会员而烦恼,使您的论坛早日成为一流的论坛。详情请登陆网站:http://www.cnsrx.cn 三人行论坛管理软件,站长必备的专业好工具。(您使用的是免费版本,购买收费版本后,将不带广告。业务QQ:247216 44985227)
页: [1]
查看完整版本: ***技巧类***可移动与隐藏的图层