pucomter重新排列序

2016年10月优秀大版主2016年8月论坛优秀版主2015年4月优秀版主2014年11月论坛优秀版主
2016年4月 荣获微软MVP称号2015年4月 荣获微软MVP称号2014年4月 荣获微软MVP称号2013年4月 荣获微软MVP称号2009年1月 荣获微软MVP称号2012年4月 荣获微软MVP称号2011年4月 荣获微软MVP称号2010年4月 荣获微软MVP称号
2016年10月优秀大版主2016年8月论坛优秀版主2015年4月优秀版主2014年11月论坛优秀版主
2016年4月 荣获微软MVP称号2015年4月 荣获微软MVP称号2014年4月 荣获微软MVP称号2013年4月 荣获微软MVP称号2009年1月 荣获微软MVP称号2012年4月 荣获微软MVP称号2011年4月 荣获微软MVP称号2010年4月 荣获微软MVP称号
2016年10月优秀大版主2016年8月论坛优秀版主2015年4月优秀版主2014年11月论坛优秀版主
2016年4月 荣获微软MVP称号2015年4月 荣获微软MVP称号2014年4月 荣获微软MVP称号2013年4月 荣获微软MVP称号2009年1月 荣获微软MVP称号2012年4月 荣获微软MVP称号2011年4月 荣获微软MVP称号2010年4月 荣获微软MVP称号
2016年10月优秀大版主2016年8月论坛优秀版主2015年4月优秀版主2014年11月论坛优秀版主
2016年4月 荣获微软MVP称号2015年4月 荣获微软MVP称号2014年4月 荣获微软MVP称号2013年4月 荣获微软MVP称号2009年1月 荣获微软MVP称号2012年4月 荣获微软MVP称号2011年4月 荣获微软MVP称号2010年4月 荣获微软MVP称号
2016年10月优秀大版主2016年8月论坛优秀版主2015年4月优秀版主2014年11月论坛优秀版主
2016年4月 荣获微软MVP称号2015年4月 荣获微软MVP称号2014年4月 荣获微软MVP称号2013年4月 荣获微软MVP称号2009年1月 荣获微软MVP称号2012年4月 荣获微软MVP称号2011年4月 荣获微软MVP称号2010年4月 荣获微软MVP称号
2016年10月优秀大版主2016年8月论坛优秀版主2015年4月优秀版主2014年11月论坛优秀版主
2016年4月 荣获微软MVP称号2015年4月 荣获微软MVP称号2014年4月 荣获微软MVP称号2013年4月 荣获微软MVP称号2009年1月 荣获微软MVP称号2012年4月 荣获微软MVP称号2011年4月 荣获微软MVP称号2010年4月 荣获微软MVP称号
2016年10月优秀大版主2016年8月论坛优秀版主2015年4月优秀版主2014年11月论坛优秀版主
2016年4月 荣获微软MVP称号2015年4月 荣获微软MVP称号2014年4月 荣获微软MVP称号2013年4月 荣获微软MVP称号2009年1月 荣获微软MVP称号2012年4月 荣获微软MVP称号2011年4月 荣获微软MVP称号2010年4月 荣获微软MVP称号
2016年10月优秀大版主2016年8月论坛优秀版主2015年4月优秀版主2014年11月论坛优秀版主
2016年4月 荣获微软MVP称号2015年4月 荣获微软MVP称号2014年4月 荣获微软MVP称号2013年4月 荣获微软MVP称号2009年1月 荣获微软MVP称号2012年4月 荣获微软MVP称号2011年4月 荣获微软MVP称号2010年4月 荣获微软MVP称号
2016年10月优秀大版主2016年8月论坛优秀版主2015年4月优秀版主2014年11月论坛优秀版主
2016年4月 荣获微软MVP称号2015年4月 荣获微软MVP称号2014年4月 荣获微软MVP称号2013年4月 荣获微软MVP称号2009年1月 荣获微软MVP称号2012年4月 荣获微软MVP称号2011年4月 荣获微软MVP称号2010年4月 荣获微软MVP称号
2016年10月优秀大版主2016年8月论坛优秀版主2015年4月优秀版主2014年11月论坛优秀版主
2016年4月 荣获微软MVP称号2015年4月 荣获微软MVP称号2014年4月 荣获微软MVP称号2013年4月 荣获微软MVP称号2009年1月 荣获微软MVP称号2012年4月 荣获微软MVP称号2011年4月 荣获微软MVP称号2010年4月 荣获微软MVP称号
2016年10月优秀大版主2016年8月论坛优秀版主2015年4月优秀版主2014年11月论坛优秀版主
2016年4月 荣获微软MVP称号2015年4月 荣获微软MVP称号2014年4月 荣获微软MVP称号2013年4月 荣获微软MVP称号2009年1月 荣获微软MVP称号2012年4月 荣获微软MVP称号2011年4月 荣获微软MVP称号2010年4月 荣获微软MVP称号
2016年10月优秀大版主2016年8月论坛优秀版主2015年4月优秀版主2014年11月论坛优秀版主
2016年4月 荣获微软MVP称号2015年4月 荣获微软MVP称号2014年4月 荣获微软MVP称号2013年4月 荣获微软MVP称号2009年1月 荣获微软MVP称号2012年4月 荣获微软MVP称号2011年4月 荣获微软MVP称号2010年4月 荣获微软MVP称号
2016年10月优秀大版主2016年8月论坛优秀版主2015年4月优秀版主2014年11月论坛优秀版主
2016年4月 荣获微软MVP称号2015年4月 荣获微软MVP称号2014年4月 荣获微软MVP称号2013年4月 荣获微软MVP称号2009年1月 荣获微软MVP称号2012年4月 荣获微软MVP称号2011年4月 荣获微软MVP称号2010年4月 荣获微软MVP称号
2016年10月优秀大版主2016年8月论坛优秀版主2015年4月优秀版主2014年11月论坛优秀版主
2016年4月 荣获微软MVP称号2015年4月 荣获微软MVP称号2014年4月 荣获微软MVP称号2013年4月 荣获微软MVP称号2009年1月 荣获微软MVP称号2012年4月 荣获微软MVP称号2011年4月 荣获微软MVP称号2010年4月 荣获微软MVP称号
2016年10月优秀大版主2016年8月论坛优秀版主2015年4月优秀版主2014年11月论坛优秀版主
2016年4月 荣获微软MVP称号2015年4月 荣获微软MVP称号2014年4月 荣获微软MVP称号2013年4月 荣获微软MVP称号2009年1月 荣获微软MVP称号2012年4月 荣获微软MVP称号2011年4月 荣获微软MVP称号2010年4月 荣获微软MVP称号
2016年10月优秀大版主2016年8月论坛优秀版主2015年4月优秀版主2014年11月论坛优秀版主
2016年4月 荣获微软MVP称号2015年4月 荣获微软MVP称号2014年4月 荣获微软MVP称号2013年4月 荣获微软MVP称号2009年1月 荣获微软MVP称号2012年4月 荣获微软MVP称号2011年4月 荣获微软MVP称号2010年4月 荣获微软MVP称号
匿名用户不能发表回复!|
每天回帖即可获得10分可用分!小技巧:
你还可以输入10000个字符
(Ctrl+Enter)
请遵守CSDN,不得违反国家法律法规。
转载文章请注明出自“CSDN(www.csdn.net)”。如是商业用途请联系原作者。后使用快捷导航没有帐号?
只需一步,快速开始
查看: 4828|回复: 9
求一个鼠标可以拖拽div,在一群div中可以重新排序的效果。
UID15533在线时间 小时积分636帖子离线17420 天注册时间
高级会员, 积分 636, 距离下一级还需 364 积分
搜索了一些以前的老帖子,似乎讨论不多,而且有些链接失效了,
求一个这样的代码,希望兼容性好的
UID503469在线时间 小时积分1829帖子离线17420 天注册时间
银牌会员, 积分 1829, 距离下一级还需 1171 积分
请搜索jquery ui sortable
UID15533在线时间 小时积分636帖子离线17420 天注册时间
高级会员, 积分 636, 距离下一级还需 364 积分
谢谢,我试试看
UID604224在线时间 小时积分1390帖子离线17420 天注册时间
银牌会员, 积分 1390, 距离下一级还需 1610 积分
之前写的一个,不知道是不是你要的效果。
&!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&&
&meta http-equiv=&Content-Type& content=&text/ charset=utf-8& /&
&title&无标题文档&/title&
&style type=&text/css&&
html,body,div,ul,li,h1,h2,h3,h4,h5,h6,p,span{ margin:0; padding:0;-moz-user-select: }
body{ overflow:}
ul,li{ list-style:}
li{ float:}
#appCenter{ width:750 margin:30}
#appCenter .appDiv{ margin-bottom:15_zoom:1;}
#appCenter .appDiv h3{ padding:5 border-bottom:1px #}
#appCenter ul{ overflow: margin-left:30}
#appCenter ul li{ width:80 height:80 position: margin-right:20 margin-top:20 border:1px # display:}
#appCenter ul li div{ height:68 background-position: background-repeat:no- cursor:}
#appCenter ul li p{ height:12 line-height:12 font-size:12 text-align: }
#appCenter ul li span{ display: width:19 height:19 position: right:0; top:-2 cursor:}
.plus{ background:url(http://d./album/s%3D680%3Bq%3D90/sign=90c5a5b5e207b7afd5ff/6a63fd44f1e671b4c510fd9f9a16f.jpg)}
.minus{ background:url(http://e./album/s%3D680%3Bq%3D90/sign=c114b4ab960a304ee1f3d6bb/a1ec08fa513dc8f254fbb2fb4316d86f.jpg)}
.js-newLi{ position: opacity:0.5; filter:alpha(opacity=50); width:80 height:80}
.js-newLi div{ height:68 background-position: background-repeat:no- cursor:}
.js-newLi p{ height:12 line-height:12 font-size:12 text-align: }
.js-newLi span{ display: width:19 height:19 position: right:0; top:-2 cursor:}
#appCenter ul li.js-liBorderStyle{ border:1px #}
&script type=&text/javascript&&
var $=function(element){
return typeof element==&string&?document.getElementById(element):
},_$=function(oParent,nodeName){
return oParent.getElementsByTagName(nodeName);
//模拟报文数据
var aMyApp=[{name:'应用1',src:'http://e./album/s%3D680%3Bq%3D90/sign=d7deff4e63d9f2dd7fb2e/cadd54fab3de9c82480e.jpg'},
{name:'应用2',src:'http://d./album/s%3D680%3Bq%3D90/sign=bb9f24dcac4bd11300cdb43a6a94d532/b17ecaeade.jpg'},
{name:'应用3',src:'http://b./album/s%3D680%3Bq%3D90/sign=33e12cacc995d143de76e72b43cbf33f/beca8397dda1448322.jpg'},
{name:'应用4',src:'http://b./album/s%3D680%3Bq%3D90/sign=af819ff3bd0/9a504fc2db128e91ef76c6a7ef6322.jpg'},
{name:'应用5',src:'http://g./album/s%3D680%3Bq%3D90/sign=a03c2f2b4bed2e73f8eb6/e6a7ef585d6889fcfaaf51f3de6622.jpg'},
{name:'应用6',src:'http://e./album/s%3D680%3Bq%3D90/sign=62edd168ecc5b2/abb051ecadab44aede00f.jpg'},
{name:'应用7',src:'http://c./album/s%3D680%3Bq%3D90/sign=a03df1e4c4eb/5fdf8db1cb28cb574e.jpg'},
{name:'应用8',src:'http://b./album/s%3D680%3Bq%3D90/sign=97dddb9c38a/7a899e510fb30f24b3ad2cacc995d143ad4b036e.jpg'},
{name:'应用9',src:'http://b./album/s%3D680%3Bq%3D90/sign=29a8f96b30adcbefc945fe0/ac4bda3a551904afbfbedab641b6e.jpg'}];
var aOtherApp=[{name:'应用10',src:'http://b./album/s%3D680%3Bq%3D90/sign=f4acc34cd439b60049ce0cbfd96bbd5ad6eddc4b0b8745438dbb6fd.jpg'},
{name:'应用11',src:'http://a./album/s%3D680%3Bq%3D90/sign=e76ae440a8ec8ac738e0b2/574ede2cc424c7cdbf6c.jpg'},
{name:'应用12',src:'http://h./album/s%3D680%3Bq%3D90/sign=0dbdbacce16f/a9d3fd1ff08d08094cad1c8a7865d22.jpg'},
{name:'应用13',src:'http://h./album/s%3D680%3Bq%3D90/sign=5fd7ca08f63c7ec224cf34/a686c90e7b8df8dc5522.jpg'},
{name:'应用14',src:'http://h./album/s%3D680%3Bq%3D90/sign=da6970aae4dde711e3d240fe97d4bf26/8b82b7c865ce1ed6f.jpg'},
{name:'应用15',src:'http://b./album/s%3D680%3Bq%3D90/sign=5da0c34e2e2eb938e86d79fae559f408/eac4bc6bbeb888b82b.jpg'},
{name:'应用16',src:'http://g./album/s%3D680%3Bq%3D90/sign=ee58cfb62cf5e0feea188a096c5bb31c1d2e09f2f.jpg'},
{name:'应用17',src:'http://g./album/s%3D680%3Bq%3D90/sign=831abbc1f5f6f3c68d3e/d6ca7bcb0a46f21ff0029efcfae6f.jpg'},
{name:'应用18',src:'http://d./album/s%3D680%3Bq%3D90/sign=838c8359a6efce1bee2bcbc29f6a82e3/728daba67adbb4e1c7.jpg'}];
window.onload=function(){
new AppCenter('appCenter','myApp','otherApp',{
myAppList:aMyApp,
otherAppList:aOtherApp
//应用中心类
function AppCenter(){
this.init.apply(this,arguments);
//应用中心原型
AppCenter.prototype={
//鼠标按下时的x坐标
//鼠标按下时的y坐标
//鼠标移动时的x坐标
//鼠标移动时的y坐标
//移动图标的下标
//初始化方法
// oMainDivId-主div的id sMyAppId-我的应用UL的id sOtherAppId-其他应用UL的id
//confing{object}-配置参数{myAppList:'我的应用数据{Array}',otherAppList:'其他应用数据{Array}'}
init:function(sMainDivId,sMyAppId,sOtherAppId,confing){
this.oMainDiv=$(sMainDivId);
this.oMyApp=$(sMyAppId);
this.oOtherApp=$(sOtherAppId);
this.aMyAppList=confing.myAppL
this.aOtherAppList=confing.otherAppL
this._createAppCenter(this.oMyApp,this.aMyAppList,0);
this._createAppCenter(this.oOtherApp,this.aOtherAppList,1);
this._OnApp(this.oMainDiv);
this._addDeleteApp(this.oMyApp,this.oOtherApp);
this._addDeleteApp(this.oOtherApp,this.oMyApp);
this._moveApp(this.oMyApp,this.oOtherApp);
this._moveApp(this.oOtherApp,this.oMyApp);
//创建应用中心内容
_createAppCenter:function(oElement,aAppList,flag){
var sLiContent='',len=aAppList.length,sBtnClass='';
var aAppDivList=_$(oElement,'div'),aAppPList=_$(oElement,'p');
sBtnClass=flag==0?'minus':'plus';
for(var i=0;i&i++){
sLiContent+='&li&&div&&/div&&p&&/p&&span class=&'+sBtnClass+'&&&/span&&/li&';
oElement.innerHTML=sLiC
for(var j=0;j&j++){
var div=aAppDivList[j],p=aAppPList[j],params=aAppList[j];
div.style.backgroundImage=&url(&+params.src+&)&;
p.innerHTML=params.
//鼠标移入移出图标
_OnApp:function(oMainDiv){
var _this=
oMainDiv.onmouseover=function(event){
var e=event||window.event,t=e.target||e.srcE
if(t.nodeName.toLowerCase()=='li'){
_this.addClass(t,'js-liBorderStyle');
}else if(t.parentNode.nodeName.toLowerCase()=='li'){
_this.addClass(t.parentNode,'js-liBorderStyle');
oMainDiv.onmouseout=function(event){
var e=event||window.event,t=e.target||e.srcE
if(t.nodeName.toLowerCase()=='li'){
_this.removeClass(t,'js-liBorderStyle');
}else if(t.parentNode.nodeName.toLowerCase()=='li'){
_this.removeClass(t.parentNode,'js-liBorderStyle');
//拖动图标改变位置
_moveApp:function(oDragUl,oOtherUl){
var _this=
oDragUl.onmousedown=function(event){
var e=event||window.event,t=e.target||e.srcE
//class不是js-liBorderStyle的li元素集合
_this._aLiList=[];
if(t.nodeName.toLowerCase()=='div'&&t.className!='appDiv'){
var oLi=t.parentNode,oCopyLi=oLi.cloneNode(true),oNewLi1=document.createElement('li'),oSpan=_$(oCopyLi,'span')[0];
document.body.appendChild(oCopyLi);
_this.addClass(oCopyLi,'js-newLi');
oSpan.style.display=&none&;
oCopyLi.style.left=_this.offset(oLi).left+&px&;
oCopyLi.style.top=_this.offset(oLi).top+&px&;
oLi.parentNode.replaceChild(oNewLi1,oLi);
_this.addClass(oNewLi1,'js-liBorderStyle');
_this._downX=e.clientX;
_this._downY=e.clientY;
_this._offsetLeft=oCopyLi.offsetL
_this._offsetTop=oCopyLi.offsetT
_this.aLiList=_$(_this.oMainDiv,'li');
//_this._aLiList集合
for(var i=0,len=_this.aLiList.i&i++){
var li=_this.aLiList[i];
if(li.className!='js-liBorderStyle'){
_this._aLiList.push(li);
//鼠标按下时移动图标的位置
_this._getAppLocation(_this._offsetLeft+80,_this._offsetTop+80);
document.onmousemove=function(event){
var e=event||window.event,t=e.target||e.srcE
var _X=e.clientX,_Y=e.clientY,_mLeft=_this._offsetLeft+_X-_this._downX,_mtop=_this._offsetTop+_Y-_this._downY;
var oSize=_this._overBorder(_mLeft,_mtop);
_mLeft=oSize.left?oSize.left:_mL
_mtop=oSize.top?oSize.top:_
oCopyLi.style.left=_mLeft+&px&;
oCopyLi.style.top=_mtop+&px&;
var index=_this._getAppLocation(_mLeft,_mtop);
_this._insertApp(_Y,_this._aLiList[index],oNewLi1,_this.oMyApp);
_this._insertApp(_Y,_this._aLiList[index],oNewLi1,_this.oOtherApp);
document.onmouseup=function(event){
var e=event||window.event,t=e.target||e.srcElement,left,top,oSpan2;
left=_this.offset(oNewLi1).
top=_this.offset(oNewLi1).
_this.animate(oCopyLi,{left:left,top:top},100,function(){
document.body.removeChild(oCopyLi);
oNewLi1.innerHTML=oCopyLi.innerHTML;
oSpan2=_$(oNewLi1,'span')[0];
oSpan2.style.display=&block&;
_this.removeClass(oNewLi1,'js-liBorderStyle');
var oLiSpan=_$(oNewLi1,'span')[0];
var oPBtn=oNewLi1.parentN
oPBtn==_this.oMyApp?oLiSpan.className=&minus&:oLiSpan.className=&plus&;
document.onmousemove=
document.onmouseup=
//点击加减号增删图标 oDragUl-点击的加减号所在的UL元素 oAnotherUl-另一个UL元素
_addDeleteApp:function(oDragUl,oAnotherUl){
var aDelList=_$(oDragUl,'li'),oAddList=_$(oAnotherUl,'li'),_this=
oDragUl.onclick=function(event){
var e=event||window.event,t=e.target||e.srcE
if(t.nodeName.toLowerCase()=='span'){
var sBtnClass=t.className,pNode=t.parentNode,oCopyLi=oCopyLi2=pNode.cloneNode(true);
var oNewLi1=document.createElement('li'),oNewLi2=document.createElement('li');
document.body.appendChild(oCopyLi);
_this.addClass(oCopyLi,'js-newLi');
oCopyLi.style.left=_this.offset(pNode).left+&px&;
oCopyLi.style.top=_this.offset(pNode).top+&px&;
oDragUl.replaceChild(oNewLi1,pNode);
oAnotherUl.appendChild(oNewLi2);
_this.addClass(oNewLi1,'js-liBorderStyle');
_this.addClass(oNewLi2,'js-liBorderStyle');
_this.animate(oCopyLi,{left:_this.offset(oNewLi2).left,top:_this.offset(oNewLi2).top},150,function(){
oNewLi1.parentNode.removeChild(oNewLi1);
document.body.removeChild(oCopyLi);
oNewLi2.innerHTML=oCopyLi2.innerHTML;
_this.removeClass(oNewLi2,'js-liBorderStyle');
var oLiSpan=_$(oNewLi2,'span')[0];
sBtnClass=='plus'?oLiSpan.className=&minus&:oLiSpan.className=&plus&;
//图标超出边界处理
_overBorder:function(left,top){
var x=0,y=0,oMainDiv=this.oMainDiv,oSize={};
if(left&oMainDiv.offsetLeft){
x=oMainDiv.offsetL
if(left&oMainDiv.offsetLeft+oMainDiv.offsetWidth){
x=oMainDiv.offsetLeft+oMainDiv.offsetW
if(top&oMainDiv.offsetTop){
y=oMainDiv.offsetT
if(top&oMainDiv.offsetTop+oMainDiv.offsetHeight){
y=oMainDiv.offsetTop+oMainDiv.offsetH
oSize.left=x;
oSize.top=y;
//边框随鼠标移动改变位置
_insertApp:function(y,oOldElement,oNewElement,oParent){
var aLiList=_$(oParent,'li'),oLastLi=aLiList[aLiList.length-1];
if(y&this.offset(oParent).top&&y&this.offset(oParent).top+oParent.offsetHeight){
oParent.insertBefore(oNewElement,oOldElement);
}catch(error){
oParent.appendChild(oNewElement);
//计算移动图标所处的位置
_getAppLocation:function(x,y){
var liList=this.aLiList,liW=liList[0].offsetW
for(var i=0,len=liList.i&i++){
var li=liList[i],left=this.offset(li).left,top=this.offset(li).
if((x&left-liW+40&&x&left+liW-40)&&y&top-liW+20&&y&top+liW-20){
this._index=i;
return this._
//添加class
addClass:function(node,_className){
if(!node.className){
node.className=_classN
node.className+=& &+_classN
//删除class
removeClass:function(node,_className){
var string=node.classN
if(string.indexOf(_className)&0){
node.className=string.replace(' '+ _className,'');
}else if(string.indexOf(_className)==0){
if(string.indexOf(' ')&0){
node.className=string.replace(_className,'');
node.className=string.replace(_className+' ','');
//动画方法 obj-动画元素
params{object}-参数{left:'',top:''} time-时间 handler-回调函数
animate:function(obj,params,time,handler){
var node=$(obj),handlerFlag=true,_style=node.currentStyle?node.currentStyle:window.getComputedStyle(node,null);
time=document.all?time*0.6:time*0.9;
for(var p in params){
(function(n){
if(n==&left&||n==&top&){
var _old=parseInt(_style[n]),_new=parseInt(params[n]),_length=0,_tt=10;
if(!isNaN(_old)){
var count=_old,length=_old&=_new?(_new-_old):(_old-_new),speed=length/time*_tt,flag=0;
var anim=setInterval(function(){
node.style[n]=count+&px&;
count=_old&=_new?count+speed:count-
if(flag&=time){
node.style[n]=_new+&px&;
clearInterval(anim);
var timeHandler=setTimeout(function(){
if(handler&&typeof handler==&function&){
handler();
clearTimeout(timeHandler);
},time+100);
//元素在文档中的位置
offset:function(obj){
var _offset={},node=$(obj);
var left=node.offsetLeft,top=node.offsetT
var parent = node.offsetP
while(parent!=null){
left += parent.offsetL
+= parent.offsetT
parent = parent.offsetP
_offset.left=
_offset.top=
//获取元素样式
getStyle:function(obj,_style){
var node=$(obj);
return node.currentStyle?node.currentStyle[_style]:window.getComputedStyle(node,null)[_style];
&body onselectstart=&return false&&
&div id=&appCenter&&
&div class=&appDiv&&
&h3&我的应用&/h3&
&ul id=&myApp&&&/ul&
&div class=&appDiv&&
&h3&其他应用&/h3&
&ul id=&otherApp&&&/ul&
&提示:您可以先修改部分代码再运行
UID15533在线时间 小时积分636帖子离线17420 天注册时间
高级会员, 积分 636, 距离下一级还需 364 积分
2楼和4楼的代码&&我看来看去& &不管怎么拖拽
源代码里面都没有任何地方改变,比如某个元素的位置
这样的话& &我该用什么办法来保存他们改变过的位置呢&&我想保存到数据库
UID664023在线时间 小时积分118帖子离线17420 天注册时间
初级会员, 积分 118, 距离下一级还需 82 积分
:):):)顶一下。。。。。。。。。
UID604224在线时间 小时积分1390帖子离线17420 天注册时间
银牌会员, 积分 1390, 距离下一级还需 1610 积分
2楼和4楼的代码&&我看来看去& &不管怎么拖拽
源代码里面都没有任何地方改变,比如某个元素的位置
这样的 ...
你在保存的时候遍历一下,然后把相应的元素数据存入数组中,然后存到数据库里一个json字符串就行
数据类似这样[{name:'应用1',src:'http://e./album/s%3D680%3Bq%3D90/sign=d7deff4e63d9f2dd7fb2e/cadd54fab3de9c82480e.jpg'},
& & & & & & & & & & & & {name:'应用2',src:'http://d./album/s%3D680%3Bq%3D90/sign=bb9f24dcac4bd11300cdb43a6a94d532/b17ecaeade.jpg'},
& & & & & & & & & & & & {name:'应用3',src:'http://b./album/s%3D680%3Bq%3D90/sign=33e12cacc995d143de76e72b43cbf33f/beca8397dda1448322.jpg'},
& & & & & & & & & & & & {name:'应用4',src:'http://b./album/s%3D680%3Bq%3D90/sign=af819ff3bd0/9a504fc2db128e91ef76c6a7ef6322.jpg'},
& & & & & & & & & & & & {name:'应用5',src:'http://g./album/s%3D680%3Bq%3D90/sign=a03c2f2b4bed2e73f8eb6/e6a7ef585d6889fcfaaf51f3de6622.jpg'},
& & & & & & & & & & & & {name:'应用6',src:'http://e./album/s%3D680%3Bq%3D90/sign=62edd168ecc5b2/abb051ecadab44aede00f.jpg'},
& & & & & & & & & & & & {name:'应用7',src:'http://c./album/s%3D680%3Bq%3D90/sign=a03df1e4c4eb/5fdf8db1cb28cb574e.jpg'},
& & & & & & & & & & & & {name:'应用8',src:'http://b./album/s%3D680%3Bq%3D90/sign=97dddb9c38a/7a899e510fb30f24b3ad2cacc995d143ad4b036e.jpg'},
& & & & & & & & & & & & {name:'应用9',src:'http://b./album/s%3D680%3Bq%3D90/sign=29a8f96b30adcbefc945fe0/ac4bda3a551904afbfbedab641b6e.jpg'}]复制代码
UID672142在线时间 小时积分78帖子离线17420 天注册时间
初级会员, 积分 78, 距离下一级还需 122 积分
还是先看看大家怎么玩的再说吧~~~~~~~~~~~~~~~~
UID15533在线时间 小时积分636帖子离线17420 天注册时间
高级会员, 积分 636, 距离下一级还需 364 积分
你在保存的时候遍历一下,然后把相应的元素数据存入数组中,然后存到数据库里一个json字符串就行
谢谢&&用你的方法学习一下试试看
UID15533在线时间 小时积分636帖子离线17420 天注册时间
高级会员, 积分 636, 距离下一级还需 364 积分
太感谢了&&基本上搞定&&json有点困惑& & 因为是用的asp&&解析起来很麻烦
我给每个item添加一个隐藏域&&提交的时候根据获取到的值 组成一个数组,就有顺序可以保存了& &
Powered byexcel中筛选后如何重新排序及户编号?
excel&中筛选后的选项如何排序?在excel&中有一组数据,有&&夫妻,户主,,儿媳&等项目,我筛选出&&户主&之后,需要给所有&户主&重新编一个从的序列,应该如何去做?答案:比如户主是在A列,编号在B列,首先将&户主&的列表筛选出来,在第一个单元格对应的B列单元格输入公式=TEXT(SUBTOTAL(3,A$N:AN),"0000"),不要急于按回车键,直接按住鼠标向下拖动即可完成排序的填充。其中,公式中的N是所在行的行号,比如筛选出来的第一个单元格是A4,那么公式就为=TEXT(SUBTOTAL(3,A$4:A4),"0000"),把公式向下拖就完成了。取消筛选,这样所有的户主都编上号了。户编号方法:COUNTIF函数,就两个参数,前面的一个为区域,后面的为条件,条件之所以用绝对引用,是因为楼主所有统计的就是有多少个&户主&,而B2单元格正好是这个内容。至于区域,起点用了绝对引用,表示起点是不变的,终点随目标行变动,所以用了相对引用,用目标行走到哪儿,统计区域追随到哪儿。例:=COUNTIF(B$2:B2,$B$2)
分享这篇日志的人也喜欢
大家晚上好呀
《美味奇缘》发布会
不及第一次遇见你
你不来,我老了???
#纽约时装周#蜜糖男友唐禹哲撩撩撩不停
真心换真心
热门日志推荐
人人最热标签
北京千橡网景科技发展有限公司:
文网文[号··京公网安备号·甲测资字
文化部监督电子邮箱:wlwh@··
文明办网文明上网举报电话: 举报邮箱:&&&&&&&&&&&&
请输入手机号,完成注册
请输入验证码
密码必须由6-20个字符组成
下载人人客户端
品评校花校草,体验校园广场

我要回帖

更多关于 lrscaomso重新排列 的文章

 

随机推荐