diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/event/timestamp | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/api/event/timestamp')
-rw-r--r-- | files/zh-cn/web/api/event/timestamp/index.html | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/event/timestamp/index.html b/files/zh-cn/web/api/event/timestamp/index.html new file mode 100644 index 0000000000..3e877af22b --- /dev/null +++ b/files/zh-cn/web/api/event/timestamp/index.html @@ -0,0 +1,55 @@ +--- +title: event.timeStamp +slug: Web/API/Event/timeStamp +tags: + - API + - DOM + - Event + - timeStamp +translation_of: Web/API/Event/timeStamp +--- +<div>{{APIRef}}</div> + +<div> </div> + +<div class="warning"><strong>警告:</strong> 在Gecko中,该属性的值不是事件发生时正确的事件戳.查看 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=238041" title="https://bugzilla.mozilla.org/show_bug.cgi?id=238041">https://bugzilla.mozilla.org/show_bug.cgi?id=238041</a></div> + +<h3 id="Summary" name="Summary">概述</h3> + +<p>返回事件发生时的时间戳.</p> + +<h3 id="Syntax" name="Syntax">语法</h3> + +<pre class="eval" style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.286em; margin-left: 0px; padding-top: 15px; padding-right: 15px; padding-bottom: 15px; padding-left: 15px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dotted; border-right-style: dotted; border-bottom-style: dotted; border-left-style: dotted; background-clip: initial; background-color: rgb(246, 246, 242); font: normal normal normal 100%/normal 'Courier New', 'Andale Mono', monospace;"><em>var number</em> = event.timeStamp; +</pre> + +<h3 id="Syntax" name="Syntax">例子</h3> + +<pre class="brush: html"><html> +<head> + +<title>timeStamp example</title> + +<script type="text/javascript"> +function getTime(event) { + document.getElementById("time").firstChild.nodeValue = event.timeStamp; +} +</script> +</head> + +<body onkeypress="getTime(event)"> + +<p>按下任意键获取onkeypress事件对象的timestamp属性值.</p> +<p>timeStamp: <span id="time">-</span></p> + +</body> +</html> +</pre> + +<h3 id="Notes" name="Notes">备注</h3> + +<p>此属性仅适用于事件系统支持该属性的特定事件类型.</p> + +<h3 id="Specification" name="Specification">规范</h3> + +<p><a class="external" href="http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html#Events-Event-timeStamp">event.timestamp</a></p> |