public/plugins/jquery/jquery-dad/jquery.dad.js
(开头部分) 9KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/*!
* jquery.dad.js v1 (http://konsolestudio.com/dad)
* Author William Lima
*/
(function ($) {
'use strict';
var supportsTouch = 'ontouchstart' in window || navigator.msMaxTouchPoints;
$.fn.dad = function (opts) {
var _this = this;
var defaults = {
target: '>div',
draggable: false,
placeholder: '',
callback: false,
containerClass: 'dad-container',
childrenClass: 'dads-children',
cloneClass: 'dads-children-clone',
active: true,
};
var options = $.extend({}, defaults, opts);
options.draggable ? $(options.draggable, this).attr('title', '按住鼠标左键拖动更换位置') : $(this).attr('title', '按住鼠标左键拖动更换位置');
$(this).each(function () {
var active = options.active;
var $daddy = $(this);
var childrenClass = options.childrenClass;
var cloneClass = options.cloneClass;
var jQclass = '.' + childrenClass;
var $target = $daddy.find(options.target);
var placeholder = options.placeholder;
var callback = options.callback;
var dragClass = 'dad-draggable-area';
var holderClass = 'dads-children-placeholder';
// HANDLE MOUSE
var mouse = {
x: 0,
y: 0,
target: false,
clone: false,
placeholder: false,
cloneoffset: {
x: 0,
y: 0,
},
updatePosition: function (e) {
this.x = e.pageX;
this.y = e.pageY;
},
move: function (e) {
this.updatePosition(e);
if (this.clone !== false && _this.target !== false) {
this.clone.css({
left: this.x - this.cloneoffset.x,
top: this.y - this.cloneoffset.y,
后面还有 250 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。