From b5b6a8929053e639a12822dfdac9604753c6efef Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Tue, 20 Jul 2021 00:33:12 +0900 Subject: Web/API/GlobalEventHandlers 以下の onclick, onmousedown, onmouseup を更新 (#1505) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2021/07/11 時点の英語版に同期 --- .../api/globaleventhandlers/onmouseup/index.html | 71 +++++++++------------- 1 file changed, 28 insertions(+), 43 deletions(-) (limited to 'files/ja/web/api/globaleventhandlers/onmouseup') diff --git a/files/ja/web/api/globaleventhandlers/onmouseup/index.html b/files/ja/web/api/globaleventhandlers/onmouseup/index.html index 21837138aa..1e61e7795e 100644 --- a/files/ja/web/api/globaleventhandlers/onmouseup/index.html +++ b/files/ja/web/api/globaleventhandlers/onmouseup/index.html @@ -1,47 +1,49 @@ --- -title: element.onmouseup +title: GlobalEventHandlers.onmouseup slug: Web/API/GlobalEventHandlers/onmouseup tags: - - API - - Event Handler - - GlobalEventHandlers - - HTML DOM - - Property - - Reference +- API +- Event Handler +- GlobalEventHandlers +- HTML DOM +- Property +- Reference +browser-compat: api.GlobalEventHandlers.onmouseup translation_of: Web/API/GlobalEventHandlers/onmouseup ---
{{ApiRef("HTML DOM")}}
-

onmouseup は {{domxref("GlobalEventHandlers")}} ミックスインのプロパティで、{{event("mouseup")}} イベントを処理する{{domxref("EventHandler" ,"イベントハンドラー")}}です。

+

onmouseup は {{domxref("GlobalEventHandlers")}} ミックスインのプロパティで、{{event("mouseup")}} イベントを処理するイベントハンドラーです。

-

mouseup イベントは、ユーザーがマウスボタンを離したときに発生します。

+

mouseup イベントは、ユーザーがマウスボタンを離したときに発行されます。

-
-

メモ: onmouseup の反対の動作は {{domxref("GlobalEventHandlers.onmousedown", "onmousedown")}} です。

+
+

メモ: onmouseup の反対の動作は {{domxref("GlobalEventHandlers.onmousedown", "onmousedown")}} です。

-

構文

+

構文

-
target.onmouseup = functionRef;
+
target.onmouseup = functionRef;
-

+

-

functionRef は、関数名または関数式です。この関数は、唯一の引数として {{domxref("MouseEvent")}} オブジェクトを受け取ります。

+

functionRef は、関数名または関数式です。この関数は、唯一の引数として {{domxref("MouseEvent")}} オブジェクトを受け取ります。

-

+

この例は、マウスでクリックするとトーストが非表示になり、離すと再び表示されます。{{domxref("GlobalEventHandlers.onmousedown", "onmousedown")}} と onmouseup イベントハンドラーを使用します。

HTML

-
<div class="container">
+
<div class="container">
   <div class="toaster"></div>
   <div class="toast">Hello world!</div>
 </div>

CSS

-
.container {
+
.container {
   position: absolute;
   left: 50%;
   bottom: 20px;
@@ -75,7 +77,7 @@ translation_of: Web/API/GlobalEventHandlers/onmouseup
 
 

JavaScript

-
function depress() {
+
function depress() {
   toast.classList.add('depressed');
 }
 
@@ -89,37 +91,20 @@ const toast = document.querySelector('.toast');
 toaster.onmousedown = depress;
 document.onmouseup = release;
-

結果

+

結果

{{EmbedLiveSample("Example", 700, 200)}}

-

仕様

+

仕様書

- - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('HTML WHATWG','webappapis.html#handler-onmouseup','onmouseup')}}{{Spec2('HTML WHATWG')}}
+{{Specifications}} -

ブラウザの互換性

+

ブラウザーの互換性

-
+

{{Compat}}

- -

{{Compat("api.GlobalEventHandlers.onmouseup")}}

-
- -

関連情報

+

関連情報

    -
  • {{event("mouseup")}} event
  • +
  • {{event("mouseup")}} イベント
-- cgit v1.2.3-54-g00ecf