blob: 1bc8c4589b0fb784e92c10c7aefada559d2075a0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
---
title: 'Element: DOMActivate イベント'
slug: Web/API/Element/DOMActivate_event
tags:
- API
- DOM
- Deprecated
- Element
- Event
- Input
- Mouse Events
- MouseEvent
- Reference
- activate event
- onactivate
translation_of: Web/API/Element/DOMActivate_event
---
<p>{{APIRef}}</p>
<div>{{Deprecated_Header}}</div>
<p><code><strong>DOMActivate</strong></code> イベントは、要素がアクティブになったとき、例えば、マウスを使ったりキーを押したりしてそこに移動したときに発行されます。</p>
<table class="properties">
<tbody>
<tr>
<th scope="row">バブリング</th>
<td>あり</td>
</tr>
<tr>
<th scope="row">キャンセル</th>
<td>可</td>
</tr>
<tr>
<th scope="row">インターフェイス</th>
<td>{{domxref("MouseEvent")}}</td>
</tr>
</tbody>
</table>
<h2 id="Examples" name="Examples">例</h2>
<pre class="brush: html notranslate"><svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny"
xmlns:ev="http://www.w3.org/2001/xml-events"
width="6cm" height="5cm" viewBox="0 0 600 500">
<desc>Example: invoke an ECMAScript function from a DOMActivate event</desc>
<!-- ECMAScript to change the radius -->
<script type="application/ecmascript"><![CDATA[
function change(evt) {
var circle = evt.target;
var currentRadius = circle.getFloatTrait("r");
if (currentRadius == 100)
circle.setFloatTrait("r", currentRadius * 2);
else
circle.setFloatTrait("r", currentRadius * 0.5);
}
]]></script>
<!-- Act on each DOMActivate event -->
<circle cx="300" cy="225" r="100" fill="red">
<handler type="application/ecmascript" ev:event="DOMActivate"> change(evt); </handler>
</circle>
<text x="300" y="480" font-family="Verdana" font-size="35" text-anchor="middle">
Activate the circle to change its size
</text>
</svg>
</pre>
<p>{{EmbedLiveSample("Examples", 640, 200)}}</p>
<h2 id="Specifications" name="Specifications">仕様書</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">仕様書</th>
<th scope="col">状態</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{SpecName('UI Events', '#event-type-DOMActivate', 'DOMActivate')}}</td>
<td>{{Spec2('UI Events')}}</td>
</tr>
</tbody>
</table>
<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2>
<p>{{Compat("api.Element.DOMActivate_event")}}</p>
<h2 id="See_also" name="See_also">関連情報</h2>
<ul>
<li>{{domxref("MouseEvent")}}</li>
<li>{{domxref("Element/mousedown_event", "mousedown")}}</li>
<li>{{domxref("Element/mouseup_event", "mouseup")}}</li>
<li>{{domxref("Element/mousemove_event", "mousemove")}}</li>
</ul>
|