return FALSE; $r = well_tag_thread__update(array('id' => $id), $update); return $r; } function well_tag_thread_find($tagid, $page, $pagesize) { $arr = well_tag_thread__find(array('tagid' => $tagid), array('id' => -1), $page, $pagesize); return $arr; } function well_tag_thread_find_by_tid($tid, $page, $pagesize) { $arr = well_tag_thread__find(array('tid' => $tid), array(), $page, $pagesize); return $arr; } ?>javascript - Change mouse pointer when dragging in HTML - Stack Overflow
最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Change mouse pointer when dragging in HTML - Stack Overflow

programmeradmin4浏览0评论

I have a web page where I have built a simple drag and drop scheme. I have used user-select:none to keep the text from being selected as I drag, and set cursor:pointer to keep the text-select bar from appearing when the user mouses over text. Unfortunately, when they hold the mouse button and drag an item around, the pointer changes to the I bar as if they were currently selecting text. Is there any way to change this behavior? Thanks!

I have a web page where I have built a simple drag and drop scheme. I have used user-select:none to keep the text from being selected as I drag, and set cursor:pointer to keep the text-select bar from appearing when the user mouses over text. Unfortunately, when they hold the mouse button and drag an item around, the pointer changes to the I bar as if they were currently selecting text. Is there any way to change this behavior? Thanks!

Share Improve this question asked Feb 16, 2012 at 16:08 Joshua SmithJoshua Smith 571 silver badge4 bronze badges 1
  • 1 add a class to a dragged element and set rules on it? – Madara's Ghost Commented Feb 16, 2012 at 16:10
Add a ment  | 

2 Answers 2

Reset to default 5

Is there any way to change this behavior?

Yes. You need to call prevent default on the mouse down event when you detect the user dragging the appropriate item.

Whenever I implement drag-and-drop, I place a mask over the entire page to capture the mousemove event wherever it may be. This mask has the relevant cursor set, usually cursor: move;.

发布评论

评论列表(0)

  1. 暂无评论