1 Star 0 Fork 4

qq1256807020 / flow-chart

forked from 武松 / flow-chart 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
drag.md 960 Bytes
一键复制 编辑 原始数据 按行查看 历史
newpanjing 提交于 2019-03-08 18:03 . Initial commit

drag.js

js div 实现推拽功能

用法:

    new Drag(options).register(el)

options:

名称 参数 说明
onDrag left=左边距离,top=顶部距离 推拽中
onBegin left=左边距离,top=顶部距离,x=移动的左边相对距离,y=移动的顶部相对距离 开始推拽
onEnd left=左边距离,top=顶部距离 结束推拽

支持jquery


$.fn.drag=function() {
    var options={
        onBegin:function(data) {
          
        },
        onEnd:function(data) {
          
        },
        onDrag:function(data) {
          
        }
    }
  new Drag(options).register(this);
}

jquery使用:

 $(".aa").drag();

支持vue


    Vue.directive('drag', {
        inserted(el, binding) {
            var options={};
            new Drag(options).register(el);
        }});

vue使用:

<div v-drag="{aa:123}"></div>
JavaScript
1
https://gitee.com/qq1256807020/flow-chart.git
git@gitee.com:qq1256807020/flow-chart.git
qq1256807020
flow-chart
flow-chart
master

搜索帮助