如何通过双击事件获取div插入另一个的位置。[jquery] [英] How to get the position of the div inserted in another as a result of a double click event.[jquery]

查看:75
本文介绍了如何通过双击事件获取div插入另一个的位置。[jquery]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个jquery代码如下:

$(。leadattributes)。dblclick(function(){$(。widgets).children(。leadattributes)。clone() .prependto。(#columnspace);});

这是最初的jquery。

现在第一个类.leadattributes表示侧边菜单中的一个图标,双击时从divwidget复制div(.leadattributes)并插入div#columnspace它完美地执行到那里。

现在我希望在插入后插入div的id和相对于主div的位置即(列空间)。

我是无法获得这些值。有人可以请帮助



.leadattributes是查询中使用的类。

解决方案
(。leadattributes )。DBLCLICK(函数(){

(窗口小部件)。儿童(。leadattributes )。克隆()。prependto。( #columnspace);});

这是最初的jquery。

现在第一个类.leadattributes表示侧边菜单中的一个图标,当双击复制时来自divwidget的div(。rangeadtributes)并插入div#columnspace,它完美地执行到那里。

现在我希望在插入后插入div的id及其相对于主div的位置即(列空间)。

我无法获得这些值。请有人帮忙



.leadattributes是查询中使用的类。


I have a jquery code as follows:
$(".leadattributes").dblclick(function(){ $(.widgets).children(".leadattributes").clone().prependto.("#columnspace");});
This was the initial jquery.
Now the first class ".leadattributes denotes an icon in the side menu which when double clicked copies a div (".leadattributes") from the div "widget" and inserts into the div "#columnspace" its executing perfectly till there.
Now i want the id of the div inserted and its position with respect to the main div ie (columnspace) after insertion.
i'm not able to get those values. can somebody please help

.leadattributes is a class used here in the query.

解决方案

(".leadattributes").dblclick(function(){


(.widgets).children(".leadattributes").clone().prependto.("#columnspace");});
This was the initial jquery.
Now the first class ".leadattributes denotes an icon in the side menu which when double clicked copies a div (".leadattributes") from the div "widget" and inserts into the div "#columnspace" its executing perfectly till there.
Now i want the id of the div inserted and its position with respect to the main div ie (columnspace) after insertion.
i'm not able to get those values. can somebody please help

.leadattributes is a class used here in the query.


这篇关于如何通过双击事件获取div插入另一个的位置。[jquery]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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