我处理按钮上的点击事件,当点击它时,e.detail = 0
,当我在文本框中按回车键时,由于某种原因,按钮点击被触发(asp.net) e.detail = 1
。
我在 jQuery documentation 中找不到这个,只是写了它在那里,但没有说明它的作用。
Event Properties
The following properties are guaranteed to be members of the event object, though some of their values may be undefined, depending on the event:
altKey, attrChange, attrName, bubbles, button, cancelable, charCode, clientX, clientY, ctrlKey, currentTarget, data, detail, eventPhase, fromElement, handler, keyCode, layerX, layerY, metaKey, newValue, offsetX, offsetY, originalTarget, pageX, pageY, prevValue, relatedNode, relatedTarget, screenX, screenY, shiftKey, srcElement, target, toElement, view, wheelDelta, which
最佳答案
根据MDN ,它因事件类型而异。 event.detail
属性...
Returns additional numerical information about the event, depending on the type of event. See the Notes section for details.
For mouse events, such as click, dblclick, mousedown, or mouseup, the detail property indicates how many times the mouse has been clicked in the same location for this event.
For a dblclick event the value of detail is always 2.
关于jquery - jQuery event.detail 的用法/含义是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7287098/