Movatterモバイル変換


[0]ホーム

URL:


  1. 開発者向けのウェブ技術
  2. Web API
  3. Element
  4. DOMActivate

このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docsコミュニティーについてもっと知り、仲間になるにはこちらから。

View in EnglishAlways switch to English

Element: DOMActivate イベント

非推奨;: この機能は非推奨になりました。まだ対応しているブラウザーがあるかもしれませんが、すでに関連するウェブ標準から削除されているか、削除の手続き中であるか、互換性のためだけに残されている可能性があります。使用を避け、できれば既存のコードは更新してください。このページの下部にある互換性一覧表を見て判断してください。この機能は突然動作しなくなる可能性があることに注意してください。

DOMActivate イベントは、要素がアクティブになったとき、例えば、マウスを使ったりキーを押したりしてそこに移動したときに発行されます。

構文

このイベント名をaddEventListener() 等のメソッドで使用するか、イベントハンドラープロパティを設定するかしてください。

js
addEventListener("DOMActivate", (event) => {});onDOMActivate = (event) => {};

イベント型

MouseEvent です。Event を継承しています。

Event UIEvent MouseEvent

イベントプロパティ

[...]

html
<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) { const circle = evt.target; const    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>

仕様書

Specification
UI Events
# event-type-DOMActivate

ブラウザーの互換性

関連情報

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp