欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

jquery实现的鼠标拖动排序Li或Table

程序员文章站 2022-11-17 18:36:04
1、前端页面 . 代码如下: <%@ page language="c#" autoeventwireup="true" co...

1、前端页面

. 代码如下:


<%@ page language="c#" autoeventwireup="true" codefile="拖动排序li或table.x.cs" inherits="拖动排序li或table" %>

<!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 id="head1">
<title>广告管理 </title>
<link href="styles/css.css" rel="stylesheet" type="text/css" />
<script src="scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script src="scripts/ui.core.js" type="text/javascript"></script>
<script src="scripts/ui.sortable.js" type="text/javascript"></script>

<script type="text/javascript" language="javascript">

//添加广告
function addlinks() {
editwidget("phonearticlelistpageinsorup.aspx");
}
</script>
<script type="text/javascript">
$(function () {
$('.sortable').sortable({ cursor: 'move' });
});
</script>
<script type="text/javascript">
//编辑
function editlink(prefix, aftfix, obj) {
editwidget("phonearticlelistpageinsorup.aspx?id=" + obj);
}
</script>
<script type="text/javascript">
function getsortresult(prefix, aftfix) {
var flag = document.getelementbyid("" + prefix + "_sortable_" + aftfix + "");
if (flag) {
var result = $("#" + prefix + "_sortable_" + aftfix + "").sortable('toarray');
$(":button").attr("disabled", "disabled"); $(":submit").attr("disabled", "disabled");
$("#delay_" + prefix + "_" + aftfix + "").show();
$("#normal_" + prefix + "_" + aftfix + "").hide();
$.ajax({
url: "phonearticlelistpage_2.aspx?word=" + result,
cache: false,
success: function (html) {
$("#delay_" + prefix + "_" + aftfix + "").hide();
$("#normal_" + prefix + "_" + aftfix + "").show();
$(":button").removeattr("disabled"); $(":submit").removeattr("disabled");
}
});
alert(flag);
alert("手机文章列表排列顺序保存成功!");
}
else {
alert("没有需要排序的手机文章列表!");
return false;
}
}
</script>
<script type="text/javascript">
//删除广告
function deletelink() {
if (confirm("您确定删除您刚才选中的项吗?")) {
var s = document.getelementsbyname("checkbox");
var s2 = "";
for (var i = 0; i < s.length; i++) {
if (s[i].checked) {
s2 += s[i].value + ',';
}
}
location.href = "phonearticlelistpage_2.aspx?del_id=" + s2; //这里传过去的是已逗号分隔开的id,需要在后面的页面内取出
}
}
</script>
<style type="text/css">
.sortable
{
margin: 0;
padding: 0;
}
.sortable li
{
margin: 3px 8px 3px 0;
float: left;
}
.sortable li
{
width: 250px;
height: 170px;
}
</style>
</head>
<body>
<form method="post" action="phonearticlelistpage_2.aspx" id="form1">
<table class="table1 fn-table fn-table-mouse" align="center">
<tr>
<td width="50%">
<input name="adsave" type="button" id="adsave" class="btn" onclick="getsortresult('sitelinks','text')"
value="保存顺序" />
</td>
<td width="50%" align="right">
提示:按住鼠标拖动链接,之后单击保存按钮就可以完成对链接的排列
</td>
</tr>
<tr>
<td width="100%" colspan="2" align="center" style="background-color: #f6f6f6;">
<p id="tabs">
<p id="tabs-sitelinks-text">
<p id="normal_sitelinks_text">
<ul class="sortable" id="sitelinks_sortable_text">
<li style="padding: 0; border: 1px solid #bad5f2; background: #f7fbfe; text-align: left"
id="sitelinks_text_96">
<table cellspacing="0" cellpadding="0" border="0px" style="background: #f7fbfe; width: 100%;
height: 170px; table-layout: fixed; word-wrap: break-word;">
<tr style="height: 20px;">
<td width="30%" align="left" valign="top">
<input type="checkbox" name="checkbox" value="96" />
</td>
<td width="70%" height="10px" align="left">
<a href="javascript:void(0)" onclick="editlink('sitelinks','text','96')"><font color="#cc3333">[编辑]</font>
</a>
</td>
</tr>
<tr>
<td>
<b>文章标题:</b>
</td>
<td>
法国时代复分大占地方
</td>
</tr>
<tr>
<td>
<b>列表图片:</b>
</td>
<td>
<img width="100" height="50px" src=https://www.2cto.com/uploadfile/2018/0201/20180201104617280.com/& '
alt='法国时代复分大占地方' />
</td>
</tr>
<tr>
<td>
<b>文章url:</b>
</td>
<td>
<a href='http://www.uzai.com/trip/27879.html?46400284' target="_blank">http://www.uzai.com/trip/27879.html?46400284</a>
</td>
</tr>
</table>
</li>
<li style="padding: 0; border: 1px solid #bad5f2; background: #f7fbfe; text-align: left"
id="sitelinks_text_78">
<table cellspacing="0" cellpadding="0" border="0px" style="background: #f7fbfe; width: 100%;
height: 170px; table-layout: fixed; word-wrap: break-word;">
<tr style="height: 20px;">
<td width="30%" align="left" valign="top">
<input type="checkbox" name="checkbox" value="78" />
</td>
<td width="70%" height="10px" align="left">
<a href="javascript:void(0)" onclick="editlink('sitelinks','text','78')"><font color="#cc3333">[编辑]</font>
</a>
</td>
</tr>
<tr>
<td>
<b>文章标题:</b>
</td>
<td>
医保结余7000亿花不出去 官员建议提高报销比例007
</td>
</tr>
<tr>
<td>
<b>列表图片:</b>
</td>
<td>
<img width="100" height="50px" src='http://10.1.3.203:6001/manager/menupages/phonemanage/articleimg/201312023115.jpg '
alt='医保结余7000亿花不出去 官员建议提高报销比例007' />
</td>
</tr>
<tr>
<td>
<b>文章url:</b>
</td>
<td>
<a href='http://finance.sina.com.cn/china/20131202/011217492954.shtml' target="_blank">
http://finance.sina.com.cn/china/20131202/011217492954.shtml</a>
</td>
</tr>
</table>
</li>
<li style="padding: 0; border: 1px solid #bad5f2; background: #f7fbfe; text-align: left"
id="sitelinks_text_94">
<table cellspacing="0" cellpadding="0" border="0px" style="background: #f7fbfe; width: 100%;
height: 170px; table-layout: fixed; word-wrap: break-word;">
<tr style="height: 20px;">
<td width="30%" align="left" valign="top">
<input type="checkbox" name="checkbox" value="94" />
</td>
<td width="70%" height="10px" align="left">
<a href="javascript:void(0)" onclick="editlink('sitelinks','text','94')"><font color="#cc3333">[编辑]</font>
</a>
</td>
</tr>
<tr>
<td>
<b>文章标题:</b>
</td>
<td>
新浪科技“因你而变”:卡片式社交首页新版上线
</td>
</tr>
<tr>
<td>
<b>列表图片:</b>
</td>
<td>
<img width="100" height="50px" src='http://10.1.3.203:6001/manager/menupages/phonemanage/articleimg/201312021700.jpg '
alt='新浪科技“因你而变”:卡片式社交首页新版上线' />
</td>
</tr>
<tr>
<td>
<b>文章url:</b>
</td>
<td>
<a href='http://tech.sina.com.cn/i/2013-12-02/00158965413.shtml' target="_blank">http://tech.sina.com.cn/i/2013-12-02/00158965413.shtml</a>
</td>
</tr>
</table>
</li>
<li style="padding: 0; border: 1px solid #bad5f2; background: #f7fbfe; text-align: left"
id="sitelinks_text_91">
<table cellspacing="0" cellpadding="0" border="0px" style="background: #f7fbfe; width: 100%;
height: 170px; table-layout: fixed; word-wrap: break-word;">
<tr style="height: 20px;">
<td width="30%" align="left" valign="top">
<input type="checkbox" name="checkbox" value="91" />
</td>
<td width="70%" height="10px" align="left">
<a href="javascript:void(0)" onclick="editlink('sitelinks','text','91')"><font color="#cc3333">[编辑]</font>
</a>
</td>
</tr>
<tr>
<td>
<b>文章标题:</b>
</td>
<td>
教授拒入普通病房:我的命十个人都换不来001
</td>
</tr>
<tr>
<td>
<b>列表图片:</b>
</td>
<td>
<img width="100" height="50px" src='http://10.1.3.203:6001/manager/menupages/phonemanage/articleimg/201312020214.jpg '
alt='教授拒入普通病房:我的命十个人都换不来001' />
</td>
</tr>
<tr>
<td>
<b>文章url:</b>
</td>
<td>
<a href='http://news.sohu.com/20131202/n391116380.shtml' target="_blank">http://news.sohu.com/20131202/n391116380.shtml</a>
</td>
</tr>
</table>
</li>
<li style="padding: 0; border: 1px solid #bad5f2; background: #f7fbfe; text-align: left"
id="sitelinks_text_79">
<table cellspacing="0" cellpadding="0" border="0px" style="background: #f7fbfe; width: 100%;
height: 170px; table-layout: fixed; word-wrap: break-word;">
<tr style="height: 20px;">
<td width="30%" align="left" valign="top">
<input type="checkbox" name="checkbox" value="79" />
</td>
<td width="70%" height="10px" align="left">
<a href="javascript:void(0)" onclick="editlink('sitelinks','text','79')"><font color="#cc3333">[编辑]</font>
</a>
</td>
</tr>
<tr>
<td>
<b>文章标题:</b>
</td>
<td>
广东打击伪基站抓百人 首例案件开审9人批捕002
</td>
</tr>
<tr>
<td>
<b>列表图片:</b>
</td>
<td>
<img width="100" height="50px" src='http://10.1.3.203:6001/manager/menupages/phonemanage/articleimg/201312023939.jpg '
alt='广东打击伪基站抓百人 首例案件开审9人批捕002' />
</td>
</tr>
<tr>
<td>
<b>文章url:</b>
</td>
<td>
<a href='http://tech.sina.com.cn/t/2013-12-02/01148965434.shtml' target="_blank">http://tech.sina.com.cn/t/2013-12-02/01148965434.shtml</a>
</td>
</tr>
</table>
</li>
<li style="padding: 0; border: 1px solid #bad5f2; background: #f7fbfe; text-align: left"
id="sitelinks_text_81">
<table cellspacing="0" cellpadding="0" border="0px" style="background: #f7fbfe; width: 100%;
height: 170px; table-layout: fixed; word-wrap: break-word;">
<tr style="height: 20px;">
<td width="30%" align="left" valign="top">
<input type="checkbox" name="checkbox" value="81" />
</td>
<td width="70%" height="10px" align="left">
<a href="javascript:void(0)" onclick="editlink('sitelinks','text','81')"><font color="#cc3333">[编辑]</font>
</a>
</td>
</tr>
<tr>
<td>
<b>文章标题:</b>
</td>
<td>
1男1女从南昌大学馆坠亡 女死者为该校学生003
</td>
</tr>
<tr>
<td>
<b>列表图片:</b>
</td>
<td>
<img width="100" height="50px" src='http://10.1.3.203:6001/manager/menupages/phonemanage/articleimg/201312024135.jpg '
alt='1男1女从南昌大学图书馆坠亡 女死者为该校学生003' />
</td>
</tr>
<tr>
<td>
<b>文章url:</b>
</td>
<td>
<a href='http://news.sina.com.cn/s/2013-12-02/115128865820.shtml' target="_blank">http://news.sina.com.cn/s/2013-12-02/115128865820.shtml</a>
</td>
</tr>
</table>
</li>
<li style="padding: 0; border: 1px solid #bad5f2; background: #f7fbfe; text-align: left"
id="sitelinks_text_77">
<table cellspacing="0" cellpadding="0" border="0px" style="background: #f7fbfe; width: 100%;
height: 170px; table-layout: fixed; word-wrap: break-word;">
<tr style="height: 20px;">
<td width="30%" align="left" valign="top">
<input type="checkbox" name="checkbox" value="77" />
</td>
<td width="70%" height="10px" align="left">
<a href="javascript:void(0)" onclick="editlink('sitelinks','text','77')"><font color="#cc3333">[编辑]</font>
</a>
</td>
</tr>
<tr>
<td>
<b>文章标题:</b>
</td>
<td>
河南车主遭罚服毒调查:每月办3000元月票可免罚004
</td>
</tr>
<tr>
<td>
<b>列表图片:</b>
</td>
<td>
<img width="100" height="50px" src='http://10.1.3.203:6001/manager/menupages/phonemanage/articleimg/201312022910.jpg '
alt='河南车主遭罚服毒调查:每月办3000元月票可免罚004' />
</td>
</tr>
<tr>
<td>
<b>文章url:</b>
</td>
<td>
<a href='http://news.sina.com.cn/c/2013-12-02/023928862436.shtml' target="_blank">http://news.sina.com.cn/c/2013-12-02/023928862436.shtml</a>
</td>
</tr>
</table>
</li>
<li style="padding: 0; border: 1px solid #bad5f2; background: #f7fbfe; text-align: left"
id="sitelinks_text_82">
<table cellspacing="0" cellpadding="0" border="0px" style="background: #f7fbfe; width: 100%;
height: 170px; table-layout: fixed; word-wrap: break-word;">
<tr style="height: 20px;">
<td width="30%" align="left" valign="top">
<input type="checkbox" name="checkbox" value="82" />
</td>
<td width="70%" height="10px" align="left">
<a href="javascript:void(0)" onclick="editlink('sitelinks','text','82')"><font color="#cc3333">[编辑]</font>
</a>
</td>
</tr>
<tr>
<td>
<b>文章标题:</b>
</td>
<td>
大学生见义勇为被连捅三刀 因家贫无钱医治(图)005
</td>
</tr>
<tr>
<td>
<b>列表图片:</b>
</td>
<td>
<img width="100" height="50px" src='http://10.1.3.203:6001/manager/menupages/phonemanage/articleimg/201312024219.jpg '
alt='大学生见义勇为被连捅三刀 因家贫无钱医治(图)005' />
</td>
</tr>
<tr>
<td>
<b>文章url:</b>
</td>
<td>
<a href='http://news.sina.com.cn/s/2013-12-02/052028863120.shtml' target="_blank">http://news.sina.com.cn/s/2013-12-02/052028863120.shtml</a>
</td>
</tr>
</table>
</li>
<li style="padding: 0; border: 1px solid #bad5f2; background: #f7fbfe; text-align: left"
id="sitelinks_text_80">
<table cellspacing="0" cellpadding="0" border="0px" style="background: #f7fbfe; width: 100%;
height: 170px; table-layout: fixed; word-wrap: break-word;">
<tr style="height: 20px;">
<td width="30%" align="left" valign="top">
<input type="checkbox" name="checkbox" value="80" />
</td>
<td width="70%" height="10px" align="left">
<a href="javascript:void(0)" onclick="editlink('sitelinks','text','80')"><font color="#cc3333">[编辑]</font>
</a>
</td>
</tr>
<tr>
<td>
<b>文章标题:</b>
</td>
<td>
676帽!韦德刷新盖帽纪录 前辈1100场他只用679场006
</td>
</tr>
<tr>
<td>
<b>列表图片:</b>
</td>
<td>
<img width="100" height="50px" src='http://10.1.3.203:6001/manager/menupages/phonemanage/articleimg/201312024034.jpg '
alt='676帽!韦德刷新盖帽纪录 前辈1100场他只用679场006' />
</td>
</tr>
<tr>
<td>
<b>文章url:</b>
</td>
<td>
<a href='http://sports.sina.com.cn/nba/2013-12-02/10006913299.shtml' target="_blank">
http://sports.sina.com.cn/nba/2013-12-02/10006913299.shtml</a>
</td>
</tr>
</table>
</li>
<li style="padding: 0; border: 1px solid #bad5f2; background: #f7fbfe; text-align: left"
id="sitelinks_text_83">
<table cellspacing="0" cellpadding="0" border="0px" style="background: #f7fbfe; width: 100%;
height: 170px; table-layout: fixed; word-wrap: break-word;">
<tr style="height: 20px;">
<td width="30%" align="left" valign="top">
<input type="checkbox" name="checkbox" value="83" />
</td>
<td width="70%" height="10px" align="left">
<a href="javascript:void(0)" onclick="editlink('sitelinks','text','83')"><font color="#cc3333">[编辑]</font>
</a>
</td>
</tr>
<tr>
<td>
<b>文章标题:</b>
</td>
<td>
8岁大妈秀腹肌健壮,长相神秘还被曝已有两小孩008
</td>
</tr>
<tr>
<td>
<b>列表图片:</b>
</td>
<td>
<img width="100" height="50px" src='http://10.1.3.203:6001/manager/menupages/phonemanage/articleimg/201312024516.jpg '
alt='8岁大妈秀腹肌健壮,长相神秘还被曝已有两小孩008' />
</td>
</tr>
<tr>
<td>
<b>文章url:</b>
</td>
<td>
<a href='http://net.chinabyte.com/442/12792942.shtml' target="_blank">http://net.chinabyte.com/442/12792942.shtml</a>
</td>
</tr>
</table>
</li>
</ul>
</p>
</p>
</p>
</td>
</tr>
</table>
</form>
</body>
</html>


2、css样式

[css] view plaincopy在code上查看代码片派生到我的代码片

body,p,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td{margin:0;padding:0;}
table{border-collapse:collapse;border-spacing:0;}
ol,ul{list-style:none;}

a{color:#333;text-decoration:none;}
a:hover{color:#f30;text-decoration:underline}

body{font-family:"宋体",arail,verdana;font-size:12px;line-height:1.5em;color:#222;background:#fff ;}


.clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden;}
.clearfix{display:block;}
* html .clearfix{height:1%;}
.clear{clear:both;}

/*文本对齐*/
.tr{text-align:right}
.tl{text-align:left;}
.tc{text-align:center;}

/*浮动*/
.fn-fl{float:left;}
.fn-fr{float:right;}

.m5{margin:5px;} .m10{margin:10px;}
.mt5 { margin-top:5px;}.mr5 { margin-right:5px;}.mb5 { margin-bottom:5px;}.ml5 { margin-left:5px;}
.mt10 { margin-top:10px;}.mr10 { margin-right:10px;}.mb10 { margin-bottom:10px;}.ml10 { margin-left:10px;}

.p5{padding:5px;} .p10{padding:10px;}
.pt5 { padding-top:5px;}.pr5 { padding-right:5px;}.pb5 { padding-bottom:5px;}.pl5 { padding-left:5px;}
.pt10 { padding-top:10px;}.pr10 { padding-right:10px;}.pb10 { padding-bottom:10px;}.pl10 { padding-left:10px;}

.mt30{margin-top:30px;}.mb30{margin-bottom:30px;}
.pt30{padding-top:30px;}.pb30{padding-bottom:30px;}

/*无效状态*/
input[disabled], select[disabled], textarea[disabled], input[readonly], select[readonly], textarea[readonly] {background-color: #eee;cursor: not-allowed;box-shadow:none;opacity:0.5}

/*下拉列表*/
select{border:1px solid #ccc;border-radius:3px;padding:1px 2px;}

/*输入框*/
input:-moz-placeholder,textarea:-moz-placeholder {color: #999999;}
input:-ms-input-placeholder,textarea:-ms-input-placeholder {color: #999999;}
input::-webkit-input-placeholder,textarea::-webkit-input-placeholder {color: #999999;}

.txt,textarea,input[type="text"], input[type="password"] {border: 1px solid #ccc;box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;transition: border 0.2s linear 0s, box-shadow 0.2s linear 0s;border-radius:3px;padding:2px 3px;}
.txt:focus,textarea:focus,input[type="text"]:focus, input[type="password"]:focus {border: 1px solid #2c5193;box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(44, 81, 147, 0.6);}
.txta{font-size:12px;line-height:18px;}
.txt20{width:20px;}
.txt30{width:30px;}
.txt50{width:50px;}
.txt75{width:75px;}
.txt85{width:85px;}
.txt100{width:100px;}
.txt125{width:125px;}
.txt150{width:150px;}
.txt175{width:175px;}
.txt200{width:200px;}
.txt250{width:250px;}
.txt280{width:280px;}
.txt300{width:300px;}
.txt350{width:350px;}
.txt400{width:400px;}

/*标准表格*/
.fn-table{width:100%;}
.fn-table>tbody>tr>td{padding:3px;background:#fff;border:1px solid #cedced;}
.fn-table>tbody>tr>th{background:#e3f5ff;padding:2px;border:1px solid #cedced;font-weight:bold;}

.fn-table-space>tbody>tr:nth-child(2n+1)>td{background:#efefef;}

/*细线表格*/
.fn-table-line>tbody>tr>td{}

/*鼠标hover表格*/
.fn-table-mouse>tbody>tr:nth-child(2n+1)>td{background:#efefef;}
.fn-table tr.on>tbody>tr>td,.fn-table-mouse>tbody>tr:hover>td{background:#fcf8e3;}

/*功能表格*/
.fn-table-function>tbody>tr>td:nth-child(2n+1){background:#e3f5ff;text-align:right;font-weight:bold;}
.fn-table-function>tbody>tr>td:first-child{background:#e3f5ff;text-align:right;font-weight:bold;}

/*干净表格*/
.fn-table-clear{}
.fn-table-clear>tbody>tr>td{padding:3px;background:#fff;border:none;}
.fn-table-clear>tbody>tr>th{background:#e3f5ff;padding:3px;border:none;}

/*iframe 头部样式,仅后台部分案例*/
.fn-iframe-hd{padding:2px 5px;background:#2c5193;margin-bottom:30px;line-height:22px;height:22px;color:#fff;position:fixed;left:0;top:0;width:100%;}
.fn-iframe-hd .close{background:url(/manager/themes/images/icons/closed.png) no-repeat center center;float:right;width:14px;height:13px;cursor:pointer;padding:4px 5px;margin-right:10px;}
.fn-iframe-hd .close:hover{opacity:0.8;}
.fn-iframe-hd .tt{float:left;font-weight:bold;}

/*标准tab选项卡*/
.fn-tab .hd li{float:left;margin-right:2px;padding:2px 5px;border:1px solid #2c5193;border-radius:5px 5px 0 0;cursor:pointer;background:#2c5193;color:#fff;}
.fn-tab .hd li.on{background:#4b8af9;color:#fff;border:1px solid #4b8af9;border-bottom:0;}
.fn-tab .bd{border:1px solid #ddd;padding:3px;margin-top:-1px;}
.fn-tab .bd p.item{display:none;}
.fn-tab .bd p.on{display:block;}

/*搜索框*/
.fn-searchbar{border:1px solid #cedced;padding:2px;border-radius:3px;}
.fn-searchbar input,.fn-searchbar select{vertical-align:middle;}

/*分页*/
.fn-pager{background:#e3f5ff;border:1px solid #cedced;margin:0 0 5px;border-top:0;}
.fn-pager p{line-height:26px;white-space:nowrap;word-break:break-all;}
.fn-pager input{margin-left:5px;}
.fn-pager a{border:1px solid #e3f5ff;padding:3px 5px;}
.fn-pager span.on{background:#2c5193;border:1px solid #2c5193;color:#fff;padding:3px 5px;font-weight:bold;}
.fn-pager a:hover{background:#2c5193;border:1px solid #2c5193;color:#fff;}
.fn-pager input,.fn-pager select,.fn-pager a,.fn-pager span{vertical-align:middle;}
.fn-pagerext{float:right;margin-top:-22px;}
.fn-pagerext input{vertical-align:middle;}

/*按钮*/
.btn,.fn-pager input[type='submit']{border-radius:3px;padding:1px 2px;border:1px solid #b3b3b3;cursor:pointer;background-image: linear-gradient(to bottom, #fff, #e6e6e6); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05);color:#666;line-height:20px;vertical-align:middle;text-decoration:none;padding:1px 3px\0;}
a.btn{padding:3px 6px;}
.btn:hover{background:#eee;text-decoration:none;}

.btn-on,.fn-pager input[type='submit']{background-image:linear-gradient(to bottom,#4b8af9,#2c5193);color:#fff;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.1);background-color:#2c5193;border:1px solid #2c5193\0;}
.btn-on:hover,.fn-pager input[type='submit']:hover{background:#4b8af9;color:#fff;}

.btn-gray{background:linear-gradient(to bottom,#ccc,#efefef);color:#fff;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.1);cursor:not-allowed;}
.btn-gray:hover{background:#eee;text-decoration:none;}

.btn:active{box-shadow:inset 0 1px 2px rgba(0,0,0,.25),inset 0 1px 3px rgba(0,0,0,0.15);}

#tooltip{position: absolute;border: 1px solid #333;background: #f7f5d1;padding: 2px 5px;color: #333;display: none;width: 500px;}
#tooltip{position:absolute;color:#333;display:block;background-color:#fff;border:1px solid #555;box-shadow:0 0 10px rgba(0,0,0,.3);border-radius:5px;padding:3px;min-width:160px;min-height:80px;}
#tooltip img{border-radius:5px;}

/*文字大小*/
.font12{font-size:12px;}
.font13{font-size:13px;}
.font14{font-size:14px;}
.font15{font-size:15px;}
.font16{font-size:16px;}
.font17{font-size:17px;}
.font18{font-size:18px;}
/*文字颜色*/
.font-red{color:red;}
.font-green{color:green;}
.font-white{color:white;}
.font-gray{color:gray;}

/*鼠标标记*/
.hand{cursor:pointer;}


3、主要js

jquery.js

ui.core.js

[javascript] view plaincopy在code上查看代码片派生到我的代码片

/*
* jquery ui 1.7.1
*
* copyright (c) 2009 authors.txt (http://jqueryui.com/about)
* dual licensed under the mit (mit-license.txt)
* and gpl (gpl-license.txt) licenses.
*
* http://docs.jquery.com/ui
*/
;jquery.ui || (function($) {

var _remove = $.fn.remove,
isff2 = $.browser.mozilla && (parsefloat($.browser.version) < 1.9);

//helper functions and ui object
$.ui = {
version: "1.7.1",

// $.ui.plugin is deprecated. use the proxy pattern instead.
plugin: {
add: function(module, option, set) {
var proto = $.ui[module].prototype;
for(var i in set) {
proto.plugins[i] = proto.plugins[i] || [];
proto.plugins[i].push([option, set[i]]);
}
},
call: function(instance, name, args) {
var set = instance.plugins[name];
if(!set || !instance.element[0].parentnode) { return; }

for (var i = 0; i < set.length; i++) {
if (instance.options[set[i][0]]) {
set[i][1].apply(instance.element, args);
}
}
}
},

contains: function(a, b) {
return document.comparedocumentposition
? a.comparedocumentposition(b) & 16
: a !== b && a.contains(b);
},

hasscroll: function(el, a) {

//if overflow is hidden, the element might have extra content, but the user wants to hide it
if ($(el).css('overflow') == 'hidden') { return false; }

var scroll = (a && a == 'left') ? 'scrollleft' : 'scrolltop',
has = false;

if (el[scroll] > 0) { return true; }

// todo: determine which cases actually cause this to happen
// if the element doesn't have the scroll set, see if it's possible to
// set the scroll
el[scroll] = 1;
has = (el[scroll] > 0);
el[scroll] = 0;
return has;
},

isoveraxis: function(x, reference, size) {
//determines when x coordinate is over "b" element axis
return (x > reference) && (x < (reference + size));
},

isover: function(y, x, top, left, height, width) {
//determines when x, y coordinates is over "b" element
return $.ui.isoveraxis(y, top, height) && $.ui.isoveraxis(x, left, width);
},

keycode: {
backspace: 8,
caps_lock: 20,
comma: 188,
control: 17,
delete: 46,
down: 40,
end: 35,
enter: 13,
escape: 27,
home: 36,
insert: 45,
left: 37,
numpad_add: 107,
numpad_decimal: 110,
numpad_divide: 111,
numpad_enter: 108,
numpad_multiply: 106,
numpad_subtract: 109,
page_down: 34,
page_up: 33,
period: 190,
right: 39,
shift: 16,
space: 32,
tab: 9,
up: 38
}
};

// wai-aria normalization
if (isff2) {
var attr = $.attr,
removeattr = $.fn.removeattr,
arians = "http://www.w3.org/2005/07/aaa",
ariastate = /^aria-/,
ariarole = /^wairole:/;

$.attr = function(elem, name, value) {
var set = value !== undefined;

return (name == 'role'
? (set
? attr.call(this, elem, name, "wairole:" + value)
: (attr.apply(this, arguments) || "").replace(ariarole, ""))
: (ariastate.test(name)
? (set
? elem.setattributens(arians,
name.replace(ariastate, "aaa:"), value)
: attr.call(this, elem, name.replace(ariastate, "aaa:")))
: attr.apply(this, arguments)));
};

$.fn.removeattr = function(name) {
return (ariastate.test(name)
? this.each(function() {
this.removeattributens(arians, name.replace(ariastate, ""));
}) : removeattr.call(this, name));
};
}

//jquery plugins
$.fn.extend({
remove: function() {
// safari has a native remove event which actually removes dom elements,
// so we have to use triggerhandler instead of trigger (#3037).
$("*", this).add(this).each(function() {
$(this).triggerhandler("remove");
});
return _remove.apply(this, arguments );
},

enableselection: function() {
return this
.attr('unselectable', 'off')
.css('mozuserselect', '')
.unbind('selectstart.ui');
},

disableselection: function() {
return this
.attr('unselectable', 'on')
.css('mozuserselect', 'none')
.bind('selectstart.ui', function() { return false; });
},

scrollparent: function() {
var scrollparent;
if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
scrollparent = this.parents().filter(function() {
return (/(relative|absolute|fixed)/).test($.curcss(this,'position',1)) && (/(auto|scroll)/).test($.curcss(this,'overflow',1)+$.curcss(this,'overflow-y',1)+$.curcss(this,'overflow-x',1));
}).eq(0);
} else {
scrollparent = this.parents().filter(function() {
return (/(auto|scroll)/).test($.curcss(this,'overflow',1)+$.curcss(this,'overflow-y',1)+$.curcss(this,'overflow-x',1));
}).eq(0);
}

return (/fixed/).test(this.css('position')) || !scrollparent.length ? $(document) : scrollparent;
}
});


//additional selectors
$.extend($.expr[':'], {
data: function(elem, i, match) {
return !!$.data(elem, match[3]);
},

focusable: function(element) {
var nodename = element.nodename.tolowercase(),
tabindex = $.attr(element, 'tabindex');
return (/input|select|textarea|button|object/.test(nodename)
? !element.disabled
: 'a' == nodename || 'area' == nodename
? element.href || !isnan(tabindex)
: !isnan(tabindex))
// the element and all of its ancestors must be visible
// the browser may report that the area is hidden
&& !$(element)['area' == nodename ? 'parents' : 'closest'](':hidden').length;
},

tabbable: function(element) {
var tabindex = $.attr(element, 'tabindex');
return (isnan(tabindex) || tabindex >= 0) && $(element).is(':focusable');
}
});


// $.widget is a factory to create jquery plugins
// taking some boilerplate code out of the plugin code
function getter(namespace, plugin, method, args) {
function getmethods(type) {
var methods = $[namespace][plugin][type] || [];
return (typeof methods == 'string' ? methods.split(/,?\s+/) : methods);
}

var methods = getmethods('getter');
if (args.length == 1 && typeof args[0] == 'string') {
methods = methods.concat(getmethods('gettersetter'));
}
return ($.inarray(method, methods) != -1);
}

$.widget = function(name, prototype) {
var namespace = name.split(".")[0];
name = name.split(".")[1];

// create plugin method
$.fn[name] = function(options) {
var ismethodcall = (typeof options == 'string'),
args = array.prototype.slice.call(arguments, 1);

// prevent calls to internal methods
if (ismethodcall && options.substring(0, 1) == '_') {
return this;
}

// handle getter methods
if (ismethodcall && getter(namespace, name, options, args)) {
var instance = $.data(this[0], name);
return (instance ? instance[options].apply(instance, args)
: undefined);
}

// handle initialization and non-getter methods
return this.each(function() {
var instance = $.data(this, name);

// constructor
(!instance && !ismethodcall &&
$.data(this, name, new $[namespace][name](this, options))._init());

// method call
(instance && ismethodcall && $.isfunction(instance[options]) &&
instance[options].apply(instance, args));
});
};

// create widget constructor
$[namespace] = $[namespace] || {};
$[namespace][name] = function(element, options) {
var self = this;

this.namespace = namespace;
this.widgetname = name;
this.widgeteventprefix = $[namespace][name].eventprefix || name;
this.widgetbaseclass = namespace + '-' + name;

this.options = $.extend({},
$.widget.defaults,
$[namespace][name].defaults,
$.metadata && $.metadata.get(element)[name],
options);

this.element = $(element)
.bind('setdata.' + name, function(event, key, value) {
if (event.target == element) {
return self._setdata(key, value);
}
})
.bind('getdata.' + name, function(event, key) {
if (event.target == element) {
return self._getdata(key);
}
})
.bind('remove', function() {
return self.destroy();
});
};

// add widget prototype
$[namespace][name].prototype = $.extend({}, $.widget.prototype, prototype);

// todo: merge getter and gettersetter properties from widget prototype
// and plugin prototype
$[namespace][name].gettersetter = 'option';
};

$.widget.prototype = {
_init: function() {},
destroy: function() {
this.element.removedata(this.widgetname)
.removeclass(this.widgetbaseclass + '-disabled' + ' ' + this.namespace + '-state-disabled')
.removeattr('aria-disabled');
},

option: function(key, value) {
var options = key,
self = this;

if (typeof key == "string") {
if (value === undefined) {
return this._getdata(key);
}
options = {};
options[key] = value;
}

$.each(options, function(key, value) {
self._setdata(key, value);
});
},
_getdata: function(key) {
return this.options[key];
},
_setdata: function(key, value) {
this.options[key] = value;

if (key == 'disabled') {
this.element
[value ? 'addclass' : 'removeclass'](
this.widgetbaseclass + '-disabled' + ' ' +
this.namespace + '-state-disabled')
.attr("aria-disabled", value);
}
},

enable: function() {
this._setdata('disabled', false);
},
disable: function() {
this._setdata('disabled', true);
},

_trigger: function(type, event, data) {
var callback = this.options[type],
eventname = (type == this.widgeteventprefix
? type : this.widgeteventprefix + type);

event = $.event(event);
event.type = eventname;

// copy original event properties over to the new event
// this would happen if we could call $.event.fix instead of $.event
// but we don't have a way to force an event to be fixed multiple times
if (event.originalevent) {
for (var i = $.event.props.length, prop; i;) {
prop = $.event.props[--i];
event[prop] = event.originalevent[prop];
}
}

this.element.trigger(event, data);

return !($.isfunction(callback) && callback.call(this.element[0], event, data) === false
|| event.isdefaultprevented());
}
};

$.widget.defaults = {
disabled: false
};


/** mouse interaction plugin **/

$.ui.mouse = {
_mouseinit: function() {
var self = this;

this.element
.bind('mousedown.'+this.widgetname, function(event) {
return self._mousedown(event);
})
.bind('click.'+this.widgetname, function(event) {
if(self._preventclickevent) {
self._preventclickevent = false;
event.stopimmediatepropagation();
return false;
}
});

// prevent text selection in ie
if ($.browser.msie) {
this._mouseunselectable = this.element.attr('unselectable');
this.element.attr('unselectable', 'on');
}

this.started = false;
},

// todo: make sure destroying one instance of mouse doesn't mess with
// other instances of mouse
_mousedestroy: function() {
this.element.unbind('.'+this.widgetname);

// restore text selection in ie
($.browser.msie
&& this.element.attr('unselectable', this._mouseunselectable));
},

_mousedown: function(event) {
// don't let more than one widget handle mousestart
// todo: figure out why we have to use originalevent
event.originalevent = event.originalevent || {};
if (event.originalevent.mousehandled) { return; }

// we may have missed mouseup (out of window)
(this._mousestarted && this._mouseup(event));

this._mousedownevent = event;

var self = this,
btnisleft = (event.which == 1),
eliscancel = (typeof this.options.cancel == "string" ? $(event.target).parents().add(event.target).filter(this.options.cancel).length : false);
if (!btnisleft || eliscancel || !this._mousecapture(event)) {
return true;
}

this.mousedelaymet = !this.options.delay;
if (!this.mousedelaymet) {
this._mousedelaytimer = settimeout(function() {
self.mousedelaymet = true;
}, this.options.delay);
}

if (this._mousedistancemet(event) && this._mousedelaymet(event)) {
this._mousestarted = (this._mousestart(event) !== false);
if (!this._mousestarted) {
event.preventdefault();
return true;
}
}

// these delegates are required to keep context
this._mousemovedelegate = function(event) {
return self._mousemove(event);
};
this._mouseupdelegate = function(event) {
return self._mouseup(event);
};
$(document)
.bind('mousemove.'+this.widgetname, this._mousemovedelegate)
.bind('mouseup.'+this.widgetname, this._mouseupdelegate);

// preventdefault() is used to prevent the selection of text here -
// however, in safari, this causes select boxes not to be selectable
// anymore, so this fix is needed
($.browser.safari || event.preventdefault());

event.originalevent.mousehandled = true;
return true;
},

_mousemove: function(event) {
// ie mouseup check - mouseup happened when mouse was out of window
if ($.browser.msie && !event.button) {
return this._mouseup(event);
}

if (this._mousestarted) {
this._mousedrag(event);
return event.preventdefault();
}

if (this._mousedistancemet(event) && this._mousedelaymet(event)) {
this._mousestarted =
(this._mousestart(this._mousedownevent, event) !== false);
(this._mousestarted ? this._mousedrag(event) : this._mouseup(event));
}

return !this._mousestarted;
},

_mouseup: function(event) {
$(document)
.unbind('mousemove.'+this.widgetname, this._mousemovedelegate)
.unbind('mouseup.'+this.widgetname, this._mouseupdelegate);

if (this._mousestarted) {
this._mousestarted = false;
this._preventclickevent = (event.target == this._mousedownevent.target);
this._mousestop(event);
}

return false;
},

_mousedistancemet: function(event) {
return (math.max(
math.abs(this._mousedownevent.pagex - event.pagex),
math.abs(this._mousedownevent.pagey - event.pagey)
) >= this.options.distance
);
},

_mousedelaymet: function(event) {
return this.mousedelaymet;
},

// these are placeholder methods, to be overriden by extending plugin
_mousestart: function(event) {},
_mousedrag: function(event) {},
_mousestop: function(event) {},
_mousecapture: function(event) { return true; }
};

$.ui.mouse.defaults = {
cancel: null,
distance: 1,
delay: 0
};

})(jquery);


ui.sortable.js


[javascript] view plaincopy在code上查看代码片派生到我的代码片

/*
* jquery ui sortable 1.7.1
*
* copyright (c) 2009 authors.txt (http://jqueryui.com/about)
* dual licensed under the mit (mit-license.txt)
* and gpl (gpl-license.txt) licenses.
*
* http://docs.jquery.com/ui/sortables
*
* depends:
* ui.core.js
*/
(function($) {

$.widget("ui.sortable", $.extend({}, $.ui.mouse, {
_init: function() {

var o = this.options;
this.containercache = {};
this.element.addclass("ui-sortable");

//get the items
this.refresh();

//let's determine if the items are floating
this.floating = this.items.length ? (/left|right/).test(this.items[0].item.css('float')) : false;

//let's determine the parent's offset
this.offset = this.element.offset();

//initialize mouse events for interaction
this._mouseinit();

},

destroy: function() {
this.element
.removeclass("ui-sortable ui-sortable-disabled")
.removedata("sortable")
.unbind(".sortable");
this._mousedestroy();

for ( var i = this.items.length - 1; i >= 0; i-- )
this.items[i].item.removedata("sortable-item");
},

_mousecapture: function(event, overridehandle) {

if (this.reverting) {
return false;
}

if(this.options.disabled || this.options.type == 'static') return false;

//we have to refresh the items data once first
this._refreshitems(event);

//find out if the clicked node (or one of its parents) is a actual item in this.items
var currentitem = null, self = this, nodes = $(event.target).parents().each(function() {
if($.data(this, 'sortable-item') == self) {
currentitem = $(this);
return false;
}
});
if($.data(event.target, 'sortable-item') == self) currentitem = $(event.target);

if(!currentitem) return false;
if(this.options.handle && !overridehandle) {
var validhandle = false;

$(this.options.handle, currentitem).find("*").andself().each(function() { if(this == event.target) validhandle = true; });
if(!validhandle) return false;
}

this.currentitem = currentitem;
this._removecurrentsfromitems();
return true;

},

_mousestart: function(event, overridehandle, noactivation) {

var o = this.options, self = this;
this.currentcontainer = this;

//we only need to call refreshpositions, because the refreshitems call has been moved to mousecapture
this.refreshpositions();

//create and append the visible helper
this.helper = this._createhelper(event);

//cache the helper size
this._cachehelperproportions();

/*
* - position generation -
* this block generates everything position related - it's the core of draggables.
*/

//cache the margins of the original element
this._cachemargins();

//get the next scrolling parent
this.scrollparent = this.helper.scrollparent();

//the element's absolute position on the page minus margins
this.offset = this.currentitem.offset();
this.offset = {
top: this.offset.top - this.margins.top,
left: this.offset.left - this.margins.left
};

// only after we got the offset, we can change the helper's position to absolute
// todo: still need to figure out a way to make relative sorting possible
this.helper.css("position", "absolute");
this.cssposition = this.helper.css("position");

$.extend(this.offset, {
click: { //where the click happened, relative to the element
left: event.pagex - this.offset.left,
top: event.pagey - this.offset.top
},
parent: this._getparentoffset(),
relative: this._getrelativeoffset() //this is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
});

//generate the original position
this.originalposition = this._generateposition(event);
this.originalpagex = event.pagex;
this.originalpagey = event.pagey;

//adjust the mouse offset relative to the helper if 'cursorat' is supplied
if(o.cursorat)
this._adjustoffsetfromhelper(o.cursorat);

//cache the former dom position
this.domposition = { prev: this.currentitem.prev()[0], parent: this.currentitem.parent()[0] };

//if the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way
if(this.helper[0] != this.currentitem[0]) {
this.currentitem.hide();
}

//create the placeholder
this._createplaceholder();

//set a containment if given in the options
if(o.containment)
this._setcontainment();

if(o.cursor) { // cursor option
if ($('body').css("cursor")) this._storedcursor = $('body').css("cursor");
$('body').css("cursor", o.cursor);
}

if(o.opacity) { // opacity option
if (this.helper.css("opacity")) this._storedopacity = this.helper.css("opacity");
this.helper.css("opacity", o.opacity);
}

if(o.zindex) { // zindex option
if (this.helper.css("zindex")) this._storedzindex = this.helper.css("zindex");
this.helper.css("zindex", o.zindex);
}

//prepare scrolling
if(this.scrollparent[0] != document && this.scrollparent[0].tagname != 'html')
this.overflowoffset = this.scrollparent.offset();

//call callbacks
this._trigger("start", event, this._uihash());

//recache the helper size
if(!this._preservehelperproportions)
this._cachehelperproportions();


//post 'activate' events to possible containers
if(!noactivation) {
for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i]._trigger("activate", event, self._uihash(this)); }
}

//prepare possible droppables
if($.ui.ddmanager)
$.ui.ddmanager.current = this;

if ($.ui.ddmanager && !o.dropbehaviour)
$.ui.ddmanager.prepareoffsets(this, event);

this.dragging = true;

this.helper.addclass("ui-sortable-helper");
this._mousedrag(event); //execute the drag once - this causes the helper not to be visible before getting its correct position
return true;

},

_mousedrag: function(event) {

//compute the helpers position
this.position = this._generateposition(event);
this.positionabs = this._convertpositionto("absolute");

if (!this.lastpositionabs) {
this.lastpositionabs = this.positionabs;
}

//do scrolling
if(this.options.scroll) {
var o = this.options, scrolled = false;
if(this.scrollparent[0] != document && this.scrollparent[0].tagname != 'html') {

if((this.overflowoffset.top + this.scrollparent[0].offsetheight) - event.pagey < o.scrollsensitivity)
this.scrollparent[0].scrolltop = scrolled = this.scrollparent[0].scrolltop + o.scrollspeed;
else if(event.pagey - this.overflowoffset.top < o.scrollsensitivity)
this.scrollparent[0].scrolltop = scrolled = this.scrollparent[0].scrolltop - o.scrollspeed;

if((this.overflowoffset.left + this.scrollparent[0].offsetwidth) - event.pagex < o.scrollsensitivity)
this.scrollparent[0].scrollleft = scrolled = this.scrollparent[0].scrollleft + o.scrollspeed;
else if(event.pagex - this.overflowoffset.left < o.scrollsensitivity)
this.scrollparent[0].scrollleft = scrolled = this.scrollparent[0].scrollleft - o.scrollspeed;

} else {

if(event.pagey - $(document).scrolltop() < o.scrollsensitivity)
scrolled = $(document).scrolltop($(document).scrolltop() - o.scrollspeed);
else if($(window).height() - (event.pagey - $(document).scrolltop()) < o.scrollsensitivity)
scrolled = $(document).scrolltop($(document).scrolltop() + o.scrollspeed);

if(event.pagex - $(document).scrollleft() < o.scrollsensitivity)
scrolled = $(document).scrollleft($(document).scrollleft() - o.scrollspeed);
else if($(window).width() - (event.pagex - $(document).scrollleft()) < o.scrollsensitivity)
scrolled = $(document).scrollleft($(document).scrollleft() + o.scrollspeed);

}

if(scrolled !== false && $.ui.ddmanager && !o.dropbehaviour)
$.ui.ddmanager.prepareoffsets(this, event);
}

//regenerate the absolute position used for position checks
this.positionabs = this._convertpositionto("absolute");

//set the helper position
if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';

//rearrange
for (var i = this.items.length - 1; i >= 0; i--) {

//cache variables and intersection, continue if no intersection
var item = this.items[i], itemelement = item.item[0], intersection = this._intersectswithpointer(item);
if (!intersection) continue;

if(itemelement != this.currentitem[0] //cannot intersect with itself
&& this.placeholder[intersection == 1 ? "next" : "prev"]()[0] != itemelement //no useless actions that have been done before
&& !$.ui.contains(this.placeholder[0], itemelement) //no action if the item moved is the parent of the item checked
&& (this.options.type == 'semi-dynamic' ? !$.ui.contains(this.element[0], itemelement) : true)
) {

this.direction = intersection == 1 ? "down" : "up";

if (this.options.tolerance == "pointer" || this._intersectswithsides(item)) {
this._rearrange(event, item);
} else {
break;
}

this._trigger("change", event, this._uihash());
break;
}
}

//post events to containers
this._contactcontainers(event);

//interconnect with droppables
if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);

//call callbacks
this._trigger('sort', event, this._uihash());

this.lastpositionabs = this.positionabs;
return false;

},

_mousestop: function(event, nopropagation) {

if(!event) return;

//if we are using droppables, inform the manager about the drop
if ($.ui.ddmanager && !this.options.dropbehaviour)
$.ui.ddmanager.drop(this, event);

if(this.options.revert) {
var self = this;
var cur = self.placeholder.offset();

self.reverting = true;

$(this.helper).animate({
left: cur.left - this.offset.parent.left - self.margins.left + (this.offsetparent[0] == document.body ? 0 : this.offsetparent[0].scrollleft),
top: cur.top - this.offset.parent.top - self.margins.top + (this.offsetparent[0] == document.body ? 0 : this.offsetparent[0].scrolltop)
}, parseint(this.options.revert, 10) || 500, function() {
self._clear(event);
});
} else {
this._clear(event, nopropagation);
}

return false;

},

cancel: function() {

var self = this;

if(this.dragging) {

this._mouseup();

if(this.options.helper == "original")
this.currentitem.css(this._storedcss).removeclass("ui-sortable-helper");
else
this.currentitem.show();

//post deactivating events to containers
for (var i = this.containers.length - 1; i >= 0; i--){
this.containers[i]._trigger("deactivate", null, self._uihash(this));
if(this.containers[i].containercache.over) {
this.containers[i]._trigger("out", null, self._uihash(this));
this.containers[i].containercache.over = 0;
}
}

}

//$(this.placeholder[0]).remove(); would have been the jquery way - unfortunately, it unbinds all events from the original node!
if(this.placeholder[0].parentnode) this.placeholder[0].parentnode.removechild(this.placeholder[0]);
if(this.options.helper != "original" && this.helper && this.helper[0].parentnode) this.helper.remove();

$.extend(this, {
helper: null,
dragging: false,
reverting: false,
_nofinalsort: null
});

if(this.domposition.prev) {
$(this.domposition.prev).after(this.currentitem);
} else {
$(this.domposition.parent).prepend(this.currentitem);
}

return true;

},

serialize: function(o) {

var items = this._getitemsasjquery(o && o.connected);
var str = []; o = o || {};

$(items).each(function() {
var res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));
if(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2]));
});

return str.join('&');

},

toarray: function(o) {

var items = this._getitemsasjquery(o && o.connected);
var ret = []; o = o || {};

items.each(function() { ret.push($(o.item || this).attr(o.attribute || 'id') || ''); });
return ret;

},

/* be careful with the following core functions */
_intersectswith: function(item) {

var x1 = this.positionabs.left,
x2 = x1 + this.helperproportions.width,
y1 = this.positionabs.top,
y2 = y1 + this.helperproportions.height;

var l = item.left,
r = l + item.width,
t = item.top,
b = t + item.height;

var dyclick = this.offset.click.top,
dxclick = this.offset.click.left;

var isoverelement = (y1 + dyclick) > t && (y1 + dyclick) < b && (x1 + dxclick) > l && (x1 + dxclick) < r;

if( this.options.tolerance == "pointer"
|| this.options.forcepointerforcontainers
|| (this.options.tolerance != "pointer" && this.helperproportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height'])
) {
return isoverelement;
} else {

return (l < x1 + (this.helperproportions.width / 2) // right half
&& x2 - (this.helperproportions.width / 2) < r // left half
&& t < y1 + (this.helperproportions.height / 2) // bottom half
&& y2 - (this.helperproportions.height / 2) < b ); // top half

}
},

_intersectswithpointer: function(item) {

var isoverelementheight = $.ui.isoveraxis(this.positionabs.top + this.offset.click.top, item.top, item.height),
isoverelementwidth = $.ui.isoveraxis(this.positionabs.left + this.offset.click.left, item.left, item.width),
isoverelement = isoverelementheight && isoverelementwidth,
verticaldirection = this._getdragverticaldirection(),
horizontaldirection = this._getdraghorizontaldirection();

if (!isoverelement)
return false;

return this.floating ?
( ((horizontaldirection && horizontaldirection == "right") || verticaldirection == "down") ? 2 : 1 )
: ( verticaldirection && (verticaldirection == "down" ? 2 : 1) );

},

_intersectswithsides: function(item) {

var isoverbottomhalf = $.ui.isoveraxis(this.positionabs.top + this.offset.click.top, item.top + (item.height/2), item.height),
isoverrighthalf = $.ui.isoveraxis(this.positionabs.left + this.offset.click.left, item.left + (item.width/2), item.width),
verticaldirection = this._getdragverticaldirection(),
horizontaldirection = this._getdraghorizontaldirection();

if (this.floating && horizontaldirection) {
return ((horizontaldirection == "right" && isoverrighthalf) || (horizontaldirection == "left" && !isoverrighthalf));
} else {
return verticaldirection && ((verticaldirection == "down" && isoverbottomhalf) || (verticaldirection == "up&quot