jQuery可拖动-无重叠 [英] JQuery draggable - No overlap

查看:94
本文介绍了jQuery可拖动-无重叠的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以说可拖动的div->没有重叠"?

is it possible to say "draggable div's -> no overlap" ?

我认为主要问题是立场:绝对; ...对吧?

I think the mainproblem is the position:absolute; ... right?

善良的礼物 彼得

推荐答案

可拖动的jQuery UI ,除非您实际上是在进行排序之类的操作.内置最接近您所需内容的是sortable的plceholder,看起来像这样的 .

There isn't a built-in function for collision detection in jQuery UI draggable, unless you're actually after something like sorting. The closest thing that's built-in to what you want is sortable's plceholder, which looks like this.

简短的版本是,在性能方面(取决于元素的数量),每个拖动的元素的碰撞检测都不是小事,因此它被排除在库之外,因为这是非常罕见的请求.但是,您可以在可拖动的drag事件中自己计算冲突需要碰撞检测.

The short version is collision detection with every dragged element isn't trivial in terms of performance (depending on the number of elements), so it's left out of the library since it's a very rare request. You could however calculate the collisions yourself inside the draggable's drag event if you really do need the collision detection.

这篇关于jQuery可拖动-无重叠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆