From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../web/api/document/dragenter_event/index.html | 249 +++++++++++++++++++++ 1 file changed, 249 insertions(+) create mode 100644 files/zh-cn/web/api/document/dragenter_event/index.html (limited to 'files/zh-cn/web/api/document/dragenter_event') diff --git a/files/zh-cn/web/api/document/dragenter_event/index.html b/files/zh-cn/web/api/document/dragenter_event/index.html new file mode 100644 index 0000000000..1cd2fce638 --- /dev/null +++ b/files/zh-cn/web/api/document/dragenter_event/index.html @@ -0,0 +1,249 @@ +--- +title: dragenter +slug: Web/API/Document/dragenter_event +tags: + - DOM + - Event + - drag and drop + - 事件 + - 参考 + - 拖拽 +translation_of: Web/API/Document/dragenter_event +--- +
当拖动的元素或被选择的文本进入有效的放置目标时, dragenter 事件被触发。
+ +

基本信息

+ + + + + + + + + + + + + + + + + + + + + + + + +
是否冒泡
是否可取消
目标对象用户指定的元素或者body元素
接口{{domxref("DragEvent")}}
默认动作取消拖动
+ +

属性

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
属性类型描述
target {{readonlyInline}}EventTarget被拖动的元素下面的元素。
type {{readonlyInline}}DOMString事件类型
bubbles {{readonlyInline}}Boolean事件是否正常冒泡
cancelable {{readonlyInline}}Boolean事件是否已被取消?
view {{readonlyInline}}WindowProxydocument.defaultView (window of the document)
detail {{readonlyInline}}long (float)0.
dataTransferDataTransferThe data that underlies a drag-and-drop operation, known as the drag data store. Protected mode.
currentTarget {{readonlyInline}}EventTarget触发事件的元素
relatedTarget {{readonlyInline}}EventTargetFor mouseover, mouseout, mouseenter and mouseleave events: the target of the complementary event (the mouseleave target in the case of a mouseenter event). null otherwise.
screenX {{readonlyInline}}long全局(屏幕)坐标中鼠标指针的X坐标。
screenY {{readonlyInline}}long全局(屏幕)坐标中鼠标指针的Y坐标。
clientX {{readonlyInline}}long本地(DOM内容)坐标中鼠标指针的X坐标。
clientY {{readonlyInline}}long本地(DOM内容)坐标中鼠标指针的Y坐标。
button {{readonlyInline}}unsigned short鼠标事件触发时按下的按钮号:左键= 0,中键= 1(如果存在),右键= 2。 对于配置为左手使用的鼠标,其中按钮操作反转,则值从右向左读取。
buttons {{readonlyInline}}unsigned shortThe buttons being pressed when the mouse event was fired: Left button=1, Right button=2, Middle (wheel) button=4, 4th button (typically, "Browser Back" button)=8, 5th button (typically, "Browser Forward" button)=16. If two or more buttons are pressed, returns the logical sum of the values. E.g., if Left button and Right button are pressed, returns 3 (=1 | 2). More info.
mozPressure {{readonlyInline}}float触发事件时屏幕的压力值, 介于0.0到1.0之间
ctrlKey {{readonlyInline}}boolean事件触发时ctrl键是否被按下
shiftKey {{readonlyInline}}boolean事件触发时shift键是否被按下
altKey {{readonlyInline}}boolean事件触发时alt键是否被按下
metaKey {{readonlyInline}}boolean事件触发时meta键是否被按下
+ +

示例:dropzone

+ +

{{page('/zh-CN/docs/Web/Events/dragstart', '示例:dropzone')}}

+ +

规范

+ + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName("HTML WHATWG", "interaction.html#dndevents", "dragenter")}}{{Spec2("HTML WHATWG")}} 
{{SpecName("HTML5.1", "editing.html#dndevents", "dragenter")}}{{Spec2("HTML5.1")}}Initial definition
+ +

浏览器支持

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support4{{CompatGeckoDesktop("1.9.1")}}10123.1
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidAndroid WebviewChrome for AndroidFirefox Mobile (Gecko)Firefox OSIE MobileOpera MobileSafari Mobile
Basic support{{CompatNo}}{{CompatNo}}{{CompatNo}}{{CompatNo}}{{CompatNo}}{{CompatIE("10")}}{{CompatNo}}{{CompatNo}}
+
+ +

相关

+ + -- cgit v1.2.3-54-g00ecf