树形目录加移动
<http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<title>目录</title>
<style type="text/css">
<!--
ul {
list-style-type: none;
padding:0px;
margin-left:0px;
}
.ieUl {
margin-top:-3px;
margin-bottom:-3px;
}
li{
border:0px;
padding:0px;
}
body,td,th {
font-size: 12px;
}
body {
background-color: #F1F0ED;
}
-->
</style>
</head>
<body onselectstart="return false">
<%
' ------------------- 第一层目录读取 -----------------------'
'---------------<start>-------------'
set conn=server.CreateObject("adodb.connection")
conn.connectionstring="Provider=SQLOLEDB;server=b69;uid=sa;pwd=123123;database=testpd;"
conn.open
set rs=server.CreateObject("adodb.recordset")
rs.open "select top 100 a.*,(select moduleICO from [tmodule] where moduleID = a.moduleID) as folderICO,(select type from [tModule] where moduleID = a.ModuleID) as dirtype from [Tree] as a where a.rootID=0 order by a.id asc,a.hasChild desc",conn,1,1
'---------------<end>-------------'
' ------------------- 第一层目录读取 -----------------------'
%>
<div ></div>
<div ></div>
<ul style="border:0px solid #FFFFCC; width:350px;background:#F1F0ED">
<li ><img src="icon/home.gif" /> 根目录</li>
<li ><img src="icon/recycle.gif" />回收站</li>
</ul>
<div style="display:none; border:#669933 solid 1px ; background:#FFFFCC" ></div>
<script type="text/javascript"></script>
<script>
/*
----------------------
## 目录树 ##
author:teddy
createDate:2007-02-27
createMoveTreeDate:2007-03-06
createDeleteTreeDate :2007-02-28
----------------------
*/
var currentElement;
var currentObject;
var hiddenElement;
var aimElement; // 移动目标元素
var aimObject; // 移动目标dom对象
var serialNumber ;
serialNumber =0;
var upPointer;
upPointer =-1;
var mo;
var up;
mo=-1;
up=-1;
var isDrag;
isDrag = -1;
/*
树对象
*/
var iconPath = "icon/"; //设置图标文件路径
var iconSuffix ="open.gif"; //设置打开文件的后缀<区别>
function Tree(){
this.id="";
this.fatherID="";
this.hasChild=-1;
this.nameDir="";
this.ico={
folder:'',
icon:''
}
this.fileType = 0;
this.rootID = 0;
this.layer="";
this.isOpen=-1;
this.isLoad=-1;
this.isLastOne=-1;
this.parentElement=-1;
this.parentObject=-1;
this.serialNumber=-1;
}
/*
图标对象
*/
var icoCurl={
L0 : 'L0.gif', //┏
L1 : 'L1.gif', //┣
L2 : 'L2.gif', //┗
L3 : 'L3.gif', //━
L4 : 'L4.gif', //┃
PM0 : 'P0.gif', //+┏
PM1 : 'P1.gif', //+┣
PM2 : 'P2.gif', //+┗
PM3 : 'P3.gif', //+━
empty : 'L5.gif', //空白图
root : 'root.gif', //缺省的根节点图标
folder : 'folder.gif', //缺省的文件夹图标
file : 'file.gif', //缺省的文件图标
exit : 'exit.gif'
}
var icoExpand={
PM0 : 'M0.gif', //-┏
PM1 : 'M1.gif', //-┣
PM2 : 'M2.gif', //-┗