久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

在 Firefox 和 IE 中,如何在拖動不同目標時更改光

In Firefox and IE how can change the cursor while dragging over different targets?(在 Firefox 和 IE 中,如何在拖動不同目標時更改光標?)
本文介紹了在 Firefox 和 IE 中,如何在拖動不同目標時更改光標?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

在 HTML5 中進行拖放,我需要能夠根據放置目標更改光標.在 Chrome 中,這通過更改 dropEffect 來工作,

Doing drag and drop in HTML5, I need to be able to change the cursor depending upon the drop target. In Chrome this works by changing the dropEffect,

 if (e.currentTarget.id == 'dropMove') {
     e.originalEvent.dataTransfer.dropEffect = 'move';
 } else {
     e.originalEvent.dataTransfer.dropEffect = 'link';
 }

但是在 IE 和 Firefox 中更改 dropEffect 對光標沒有影響.請參閱以下小提琴:

however changing the dropEffect in IE and Firefox has no effect on the cursor. See the following Fiddle:

http://jsfiddle.net/ksoncan34/s7kN5/

我嘗試過手動設置光標,使用 window.cursor,但這也沒有效果.如何更改 Firefox 和 IE 中不同放置目標的光標?

I've tried manually setting the cursor, with window.cursor, but this also has no effect. How can I change the cursor for different drop targets in Firefox and IE?

推薦答案

我建議使用 jQuery ui -- droppable and draggable.

I'd suggest using jQuery ui -- droppable and draggable.

您可以使用 cursor: none 隱藏默認/實際光標,并使用風格化的 DOM 元素來呈現您自己的光標"元素.

You can hide the default/actual cursor using cursor: none and use a stylized DOM element to render your own 'cursor' element.

我在這里提供了一個示例:http://jsfiddle.net/lawrencealan/WMyu7/78/ (更新2017 年 6 月 8 日)

I've provided an example here: http://jsfiddle.net/lawrencealan/WMyu7/78/ (updated 6/8/2017)

注意:mousemove 在拖動可拖動"屬性元素時停止觸發.

Note: mousemove stops firing during dragging of "draggable" attributed elements.

--

截至 2019 年 9 月,該示例現已失效.

As of September 2019, the example is now broken.

這篇關于在 Firefox 和 IE 中,如何在拖動不同目標時更改光標?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How can I get my jasmine tests fixtures to load before the javascript considers the document to be quot;readyquot;?(在 javascript 認為文檔“準備好之前,如何讓我的 jasmine 測試裝置加載?) - IT屋-程序員軟件開發技術
What do jasmine runs and waitsFor actually do?(jasmine 運行和等待實際上是做什么的?)
How to provide mock files to change event of lt;input type=#39;file#39;gt; for unit testing(如何提供模擬文件來更改 lt;input type=filegt; 的事件用于單元測試)
How to unit test a chained method using Jasmine(如何使用 Jasmine 對鏈式方法進行單元測試)
How do I inject $rootScope into an AngularJS unit test?(如何將 $rootScope 注入 AngularJS 單元測試?)
Jasmine - How to spy on a function call within a function?(Jasmine - 如何監視函數中的函數調用?)
主站蜘蛛池模板: 视频一区二区三区中文字幕 | 日韩精品a在线观看图片 | 亚洲精品一区二区三区在线观看 | 欧美在线观看一区 | 81精品国产乱码久久久久久 | www.三级| 狠狠躁躁夜夜躁波多野结依 | 欧美日韩高清在线一区 | 激情的网站 | 综合久久久 | 国产一区二区在线免费播放 | 亚洲成人蜜桃 | 亚洲h视频 | 亚洲精品国产偷自在线观看 | 99re6在线视频精品免费 | 成人精品视频 | 色片在线观看 | 91免费看片| 成人网在线 | 成人在线观看免费观看 | 国产精品国产精品国产专区不片 | 国产成人99久久亚洲综合精品 | av黄色免费 | 91在线视频播放 | 久久综合久色欧美综合狠狠 | 国产成人免费视频网站视频社区 | 国产黄色av电影 | 黄色片视频网站 | 性精品| 日韩一二三区视频 | 在线免费毛片 | 亚洲一二三在线 | 丝袜美腿一区二区三区 | 日本电影韩国电影免费观看 | 在线视频99 | 日韩电影免费在线观看中文字幕 | 丝袜 亚洲 另类 欧美 综合 | 福利影院在线看 | 黄色中文字幕 | 久热久热 | 久久免费精品视频 |