easyUI draggable组件使用:

<!DOCTYPE html>
<html lang="en"> <head>
<meta charset="UTF-8">
<title>Document</title>
<script src="easyui/jquery.min.js"></script>
<script src="easyui/jquery.easyui.min.js"></script>
<script src="easyui/locale/easyui-lang-zh_CN.js"></script>
<script src="js/test003.js"></script>
<link rel="stylesheet" href="easyui/themes/default/easyui.css">
<link rel="stylesheet" href="easyui/themes/icon.css">
</head> <body>
<div id="box1" class="easyui-draggable" style="background:#ccc;width:300px;height:200px">this is draggable</div>
<div id="box" style="background:#eee;width:300px;height:200px"><div id="pox">title</div>this is JS draggable</div>
</body> </html>
$(function(argument) {
var obj = {
//revert:true,//true表示返回初始位置
//cursor:'text',//鼠标在移动过程中的样子
//handle:'#pox',//能拖动的部分,一般是在里面的title层
//disabled:true,//禁止拖动了;
//edge:10,//禁止拖动的边宽度;
//axis:'h',//v-只能竖直拖动,h-只能水平拖动
proxy: 'clone', //拖动过程中克隆一个对象
//deltaX:10,//拖动的物体其相对于鼠标的x偏移量,与proxy结合使用
//deltaY:10,//拖动的物体其相对于鼠标的y偏移量,与Proxy结合使用
// proxy:function (source) {
// console.log(source);// source是拖动的HTML对象;
// var p = $('<div style="border:1px solid #ccc;width:80px"></div>');
// p.html($(source).html()).appendTo('body');
// return p;// p是生成出来的对象,拖着走的那个;
// },
onBeforeDrag: function(e) { //对应mousedown事件
console.log('onBeforeDrag');
console.log(e);
//return false;//将取消拖动;
},
onStartDrag: function(e) { //对应mousedown事件
console.log('onStartDrag');
console.log(e);
},
onDrag: function(e) { //对应mousemove和mouseup事件
// console.log('onDrag');
// console.log(e);
//return false;//拖不动了,但是能到达目标位置;
//console.log($('#box').draggable('options'));//获得options属性
//console.log($('#box').draggable('proxy'));//获得proxy对象;
//$('#box').draggable('disable');//!!不能这样写,会崩溃的;
},
onStopDrag: function(e) { //对应mouseup事件
console.log('onStopDrag');
console.log(e);
}
};
$('#box').draggable(obj);
$('#box').draggable('disable'); // 有效果呀!
}); 

easyUI draggable组件使用的更多相关文章

  1. Easyui部分组件讲解

    Easyui部分组件讲解 目  录 1.... Accordion(可折叠标签)... 2 1.1          实例... 2 1.2          参数... 3 2.... DateBo ...

  2. Easyui主要组件用法

    Easyui主要组件用法说明: 1.  combogrid用法 说明:combogrid可提供翻页列表的数据选择并可进行数据的过滤查询(查询的传人参数为q,可在控制器中获取这个参数传过来的值,下面的示 ...

  3. 对easyui datagrid组件的一个小改进

    #对easyui datagrid组件的一个小改进 ##问题 在实际项目中使用datagrid时,受版面限制,有时候表格不能太大,这时候表格里面的内容就不能完全显示,用户需要经常拖动调整列宽才能看完整 ...

  4. easyUI panel组件

    easyUI panel组件: 属性的使用: <!DOCTYPE html> <html lang="en"> <head> <meta ...

  5. easyUI progressbar组件

    easyUI progressbar组件: <!DOCTYPE html> <html lang="en"> <head> <meta c ...

  6. easyUI linkbutton组件

    easyUI linkbutton组件: <!DOCTYPE html> <html lang="en"> <head> <meta ch ...

  7. easyUI tootip组件使用

    easyUI tootip组件使用: <!DOCTYPE html> <html lang="en"> <head> <meta char ...

  8. easyUI resizable组件使用

    easyUI resizable组件使用: <!DOCTYPE html> <html lang="en"> <head> <meta c ...

  9. easyUI droppable组件使用

    easyUI droppable组件使用: <!DOCTYPE html> <html lang="en"> <head> <meta c ...

随机推荐

  1. AIM Tech Round 3 (Div. 2)D. Recover the String(贪心+字符串)

    D. Recover the String time limit per test 1 second memory limit per test 256 megabytes input standar ...

  2. Android编程中的实用快捷键

    作为一个优秀的程序员,不但要能开发出漂亮的软件,也要能熟练掌握编程的技巧,包括IDE的快捷键使用.比如linux 下的VI编辑器,对于不熟练快捷键的人来说就是一个噩梦,但一旦你熟练了VI的快捷键,VI ...

  3. head和tail命令-----得到头尾N行或者这去掉尾头N/N-1行

    [algo@localhost tmp]$ cat test  1 2 3 4 5 head得到头部2行,删掉尾部2行 [algo@localhost tmp]$ head -n +2 test  1 ...

  4. iOS推送的众多坑

    新来的一家公司,昨天和同事解决推送问题(工程里有集成百度推送和环信即时通讯),信誓旦旦的声称:" app在前台和后台运行时,推送触发的是didReceiveRemoteNotificatio ...

  5. 常见div+css网页布局(float,absolute)

    网页布局-常见 1,           float布局 (1)常规方法 <div id="warp">     <div id="column&quo ...

  6. css3动画-animation

    animation驱使一组css style变化到另外一组css style,它可以定义keyframes的集合,指定style的开始和结束状态,它是transition的增强. 配置animatio ...

  7. 对AD域进行定期自动备份设置图解

    今天为大家讲解一下,如何对域进行定期的备份,因为如果域出问题了,在公司里那可就不好玩了啊,对做定期备份,在域出问题的时候可以及时恢复,减少对域重建而浪费大量的时间,同样也耽误公司员工的工作,这样的事情 ...

  8. iOS开发——UIAlertController

    iOS8之后,UIAlertView和UIActionSheet被干掉了,取而代之的是UIAlertController和UIAlertAction. UIAlertController有两种样式,一 ...

  9. Mac iTerm2使用rz、sz从远程上传下载文件

    使用 brew install lrzsz .如果安装遇到错误的话,使用以下方法: 在mac终端下运行: brew install lrzsz (安装教程:http://brew.sh/index_z ...

  10. 【转】23种设计模式UML图

    原文:http://blog.csdn.net/bwwlpnn/article/details/7421628