日期:2014-05-16  浏览次数:20413 次

散分:发个DIV拖拽,请各位老师指点。。。
<!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 "   />
<title> Freedom </title>

<style   type= "text/css ">
body   {
width:100%;
max-height:100%;
padding:0px;
margin:0px;
text-align:center;
}

.cell   {
float:left;
clear:right;
}

.row   {
clear:both;
}

.r_nbsp   {
width:20px;
}

.root   {
width:868px;
margin:   0   auto;
}

.root   *   {
/*次属性FF的说*/
-moz-user-select:none;
}

.line   {
width:202px;
line-height:20px;
height:20px;
overflow:hidden;
font-size:12px;
}

.move   {
border:#CCCCCC   1px   solid;
width:200px;
height:aotu;
}

.title   {
height:24px;
cursor:move;
background:#0080C0;
font-size:12px;
font-weight:bold;
color:#FFFFFF;
line-height:24px;
text-align:center;
}

.content   {
border-top:#CCCCCC   1px   solid;
height:100px;
background-color:#F7F7F7;
}

.CDrag_temp_div   {
border:#CCCCCC   1px   dashed;
}
</style>


------解决方案--------------------
MARK
很不错的东西
保存了

------解决方案--------------------
好复杂,学习
------解决方案--------------------
类的风格不错,支持,接分! :)
------解决方案--------------------
好好长。。。。。。
------解决方案--------------------
接分,,,口水俺就留个楼下的接了...
------解决方案--------------------
无聊着,这两天都不知道写了啥,,,灌一下...

function AddNewItem(sMainId, sSubTag, sItemNumMkrStart, sItemNumMkrEnd)
{
var Debug = false;
var oMain = document.getElementById(sMainId);
if(oMain==null)
{
alert( "无法获得 Main 对象! ");
return;
} // end if

var oSubList = oMain.getElementsByTagName(sSubTag);
if(oSubList.length==0)
{
alert( "获取子对象集合出错! ");
return;
} // end if

if(Debug)
{
alert( "oSubList.length: "+oSubList.length);
alert( "typeof(oSubList[oSubList.Length-1]): "+typeof(oSubList[oSubList.length-1]));
alert( "oSubList[oSubList.length-1].tagName: "+oSubList[oSubList.length-1].tagName);
}

var tempNode = document.createElement(sSubTag);
var tempNodeText = oSubList[oSubList.length-1].innerHTML;

if(sItemNumMkrStart!=null&&sItemNumMkrEnd!=null)
{
if(Debug)
{
alert( "mark text ok ");
}
var re = new RegExp( "[^ <> \\d]*([\\d]+)[\\s]* "+sItemNumMkrEnd, "i ");
tempNodeText=tempNodeText.replace
(
re
,
function($1,$2)
{
$2 = $2.replace(/^\s+|\s+$/gi, " ");