[英]Cursor Drag and Drop
I found a function to move an element from one div to another and work very well, but when i drag element the cursor change to cursor: not-allowed;
我发现了一个 function 将一个元素从一个 div 移动到另一个并且工作得很好,但是当我拖动元素时 cursor 更改为
cursor: not-allowed;
or something similar, but I want change cursor to cursor: grab;
或类似的东西,但我想将 cursor 更改为
cursor: grab;
when i move the element, how i can do this?当我移动元素时,我该怎么做?
Is the same example of this question: Example是不是这个问题的同一个例子: 例子
I try:我尝试:
#piece:focus{
cursor: grab;
}
#piece:selection{
cursor: grab;
}
#piece:hover{
cursor: grab;
}
You could, in dragStart
, add e.target.classList.add('grabbed');
您可以在
dragStart
中添加e.target.classList.add('grabbed');
and in dragEnd
, add e.target.classList.remove('grabbed');
并在
dragEnd
中添加e.target.classList.remove('grabbed');
. .
Then add css .grabbed { cursor: grab; }
然后添加 ZC7A62
.grabbed { cursor: grab; }
.grabbed { cursor: grab; }
. .grabbed { cursor: grab; }
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.