仿Google和Windows Live的拖拽
New Document
body
{
margin:10px;
}
#dragHelper
{
position:absolute;/*重要*/
border:2px dashed #000000;
background-color:#FFFFFF;
filter: alpha(opacity=30);
}
.normal
{
position:absolute;/*重要*/
width:300px;
#height:10px;
border:1px solid #666666;
background-color:#FFFFFF;
}
.over
{
position:absolute;/*重要*/
width:300px;
#height:10px;
border:1px solid #666666;
background-color:#f3f3f3;
filter: alpha(opacity=50);
}
.dragArea {
CURSOR: move;
}
Cobao | ........ | - x |
地址:http://www.cobao.cn | ||
关键字: | ||
说明: |
新浪 | ........ | - x |
地址:http://www.sina.com.cn | ||
关键字: | ||
说明: |
网易 | ........ | - x |
地址:http://www.163.com | ||
关键字: | ||
说明: |
........ | - x | |
地址:http://www.qq.com | ||
关键字: | ||
说明: |
= 0 && dragObjLeft =0)
dragObj.style.top = dragObjTop;
repaint();
}
}
//克隆对象
function cloneObject(srcObj, destObj){
destObj = srcObj.cloneNode(true);
}
function makeDraggable(element){
element.setAttribute("isDragObj", "y");
}
function repaint(){
for(i=0; i0 && parseInt(dragObj.style.top)parseInt(dragObjs[dragObjPos+1].style.top)){
dragObjs[dragObjPos] = dragObjs[dragObjPos+1];
dragObjs[dragObjPos+1] = dragHelper;
dragObjPos = dragObjPos + 1;
}
paintDragObjs();
dragObjs[dragObjPos] = dragObj;
}
function paintDragObjs(){
var h = 40;
for(i=0; i
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]