js +css 实例拖动层代码

js

<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″ />
<title>无标题文档</title>
<SCRIPT language=JavaScript>
<!–
function JM_cc(ob){
var obj=MM_findObj(ob); if (obj) {
obj.select();js=obj.createTextRange();js.execCommand(“Copy”);}
}

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>

<SCRIPT>  
var over=false,down=false,divleft,divtop,n;  
function clase(x){document.all[‘plane’+x].style.visibility=’hidden’}  
function down1(m){  
n=m;down=true;divleft=event.clientX-parseInt(m.style.left);divtop=event.clientY-parseInt(m.style.top)}  
function move(){if(down){n.style.left=event.clientX-divleft;n.style.top=event.clientY-divtop;}}</SCRIPT>

<META content=”MSHTML 5.00.2920.0″ name=GENERATOR></HEAD>
<BODY bgColor=#000000 onmousemove=move() onmouseup=down=false>
<DIV class=aa id=plane1 onmousedown=down1(this)
style=”CURSOR: move; HEIGHT: 102px; LEFT: 6px; POSITION: absolute; TOP: 27px; WIDTH: 131px; Z-INDEX: 1″>
<TABLE bgColor=#000000 border=0 cellPadding=0 cellSpacing=0 height=100
width=130>
  <TBODY>
  <TR>
    <TD bgColor=#ffffff height=18 width=131>
      <DIV align=right><FONT color=#666666 face=Verdana size=2><A
      href=”#”
      onclick=clase(1)><IMG border=0 height=9
      src=””
width=9></A> </FONT></DIV></TD></TR>
  <TR>
    <TD align=middle bgColor=#a02058 vAlign=top width=131>
      <P><FONT color=#666666 face=Verdana size=2><BR> </FONT></P></TD></TR></TBODY></TABLE></DIV>
<DIV class=aa id=plane2 onmousedown=down1(this)
style=”CURSOR: move; HEIGHT: 100px; LEFT: 6px; POSITION: absolute; TOP: 139px; WIDTH: 131px; Z-INDEX: 2″>
<TABLE bgColor=#000000 border=0 cellPadding=0 cellSpacing=0 height=100
width=130>
  <TBODY>
  <TR>
    <TD bgColor=#ffffff height=18 width=130>
      <DIV align=right><FONT color=#666666 face=Verdana size=2><A
      href=”#”
      onclick=clase(2)><IMG border=0 height=9
      src=”/down/js/images/12493942650.gif”
width=9></A> </FONT></DIV></TD></TR>
  <TR>
    <TD align=middle bgColor=#a02058 vAlign=top width=130>
      <P><FONT color=#666666 face=Verdana size=2><BR> </FONT></P></TD></TR></TBODY></TABLE></DIV>
<DIV class=aa id=plane3 onmousedown=down1(this)
style=”CURSOR: move; HEIGHT: 101px; LEFT: 6px; POSITION: absolute; TOP: 248px; WIDTH: 131px; Z-INDEX: 2″>
<TABLE bgColor=#000000 border=0 cellPadding=0 cellSpacing=0 height=100
width=130>
  <TBODY>
  <TR>
    <TD bgColor=#ffffff height=18 width=130>
      <DIV align=right><FONT color=#666666 face=Verdana size=2><A
      href=”#”
      onclick=clase(3)><IMG border=0 height=9
      src=””
width=9></A> </FONT></DIV></TD></TR>
  <TR>
    <TD align=middle bgColor=#a02058 vAlign=top width=130>
      <P><FONT color=#666666 face=Verdana size=2><BR>
      </FONT></P>
      <P></P></TD></TR></TBODY></TABLE></DIV>
<p>查找更多代码,请访问:<a href=”” target=”_blank”>中国WEB第一站</a></p>
</BODY></HTML>

js +css 实例拖动层代码

相关文章:

你感兴趣的文章:

标签云: