繁体   English   中英

有没有办法在拖动元素时获取“幽灵图像”的位置

[英]Is there a way to get the position of the "ghost image" when dragging an element

我想知道是否有办法获得元素的拖动鬼图像的位置。

设置如下:

<div id="test" v-on:dragstart="dragStart" v-on:drag="dragging" draggable="true" v-on:drop="drop" v-on:dragover="allowDrop"></div>

重影的位置将与指针/鼠标指针的位置相同。 由于您使用的是 jQuery,因此可以通过以下方式获取这些坐标(位置):

$("body").mousemove(function(e) {
    console.log('position of ghost image: ' + e.pageX + ', ' + e.pageY;
})

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM