From 6ef1fa4618e08426b874529619a66adbd3d1fcf0 Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 12:07:59 +0100 Subject: unslug ja: move --- .../web/api/mouseevent/button/index.html | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 files/ja/conflicting/web/api/mouseevent/button/index.html (limited to 'files/ja/conflicting/web/api/mouseevent') diff --git a/files/ja/conflicting/web/api/mouseevent/button/index.html b/files/ja/conflicting/web/api/mouseevent/button/index.html new file mode 100644 index 0000000000..572f611ebc --- /dev/null +++ b/files/ja/conflicting/web/api/mouseevent/button/index.html @@ -0,0 +1,60 @@ +--- +title: event.button +slug: Web/API/Event/button +tags: + - DOM + - Gecko + - Gecko DOM Reference +translation_of: Web/API/MouseEvent/button +translation_of_original: Web/API/event.button +--- +

{{ ApiRef() }}

+

Summary

+

イベントを発生させたマウスのボタンを示しています。

+

Syntax

+
var buttonCode = event.button;
+
+

state を変えたボタンを示す整数値を返します。

+ +

ボタンの順序はどのようにポインティングデバイスが設定されているかによります。

+

Example

+
<script type="text/javascript">
+
+function whichButton(e)
+{
+  // Handle different event models
+  var e = e || window.event;
+  var btnCode;
+
+  if ('object' == typeof e){
+    btnCode = e.button;
+
+    switch (btnCode){
+      case 0  : alert('Left button clicked');
+                break;
+      case 1  : alert('Middle button clicked');
+                break;
+      case 2  : alert('Right button clicked');
+                break;
+      default : alert('Unexpected code: ' + btnCode);
+    }
+  }
+}
+
+</script>
+
+<p onclick="whichButton(event);">Click with mouse...</p>
+
+
+

Notes

+

マウスのクリックはしばしばUIによって横取りされるため、ある状況では普通のクリック(通常は左クリック)でないマウスのクリックを検出することが普通のクリックよりも難しいかもしれません。

+

ユーザーはポインティングデバイスのボタンの設定を変更する可能性があり、たといこのイベントの button プロパティが 0 であったとしても、それは物理的にポインティングデバイスの最も左に存在するボタンによるものではないかもしれません。しかし、そんな場合にも、標準的なボタン配置における左クリックと同様の動作をするべきであるとされています。

+

Specification

+

DOM 2 Events Specification: button

+
+  
+

{{ languages( { "en": "en/DOM/event.button", "pl": "pl/DOM/event.button" } ) }}

-- cgit v1.2.3-54-g00ecf