From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/ja/web/api/mouseevent/clientx/index.html | 120 +++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 files/ja/web/api/mouseevent/clientx/index.html (limited to 'files/ja/web/api/mouseevent/clientx') diff --git a/files/ja/web/api/mouseevent/clientx/index.html b/files/ja/web/api/mouseevent/clientx/index.html new file mode 100644 index 0000000000..3a41a98919 --- /dev/null +++ b/files/ja/web/api/mouseevent/clientx/index.html @@ -0,0 +1,120 @@ +--- +title: MouseEvent.clientX +slug: Web/API/MouseEvent/clientX +translation_of: Web/API/MouseEvent/clientX +--- +

{{APIRef("DOM Events")}}

+ +

MouseEvent.clientX は event の起きた点の、クライアント内での X 座標を参照できる読み取り専用の属性です。画面の左上でクリックした場合、ページの横スクロール位置に関わらず、その値は 0 となります。

+ +

記法

+ +
var x = instanceOfMouseEvent.clientX
+
+ +

返り値

+ +

数値

+ +

使用例

+ +
<!DOCTYPE html>
+<html>
+<head>
+<title>clientX\clientY example</title>
+
+<script>
+function showCoords(evt){
+  alert(
+    "clientX value: " + evt.clientX + "\n" +
+    "clientY value: " + evt.clientY + "\n"
+  );
+}
+</script>
+</head>
+
+<body onmousedown="showCoords(event)">
+<p>To display the mouse coordinates click anywhere on the page.</p>
+</body>
+</html>
+
+ +

仕様

+ + + + + + + + + + + + + + + + + + + +
仕様状態コメント
{{SpecName('DOM3 Events','#widl-MouseEvent-clientX','MouseEvent.clientX')}}{{Spec2('DOM3 Events')}}{{SpecName('DOM2 Events')}} からの変更はなし
{{SpecName('DOM2 Events','#Events-MouseEvent','MouseEvent.clientX')}}{{Spec2('DOM2 Events')}}最初の定義
+ +

ブラウザ互換性

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + +
機能Firefox (Gecko)ChromeInternet ExplorerOperaSafari
基本サポート{{CompatVersionUnknown()}}{{CompatVersionUnknown()}}6{{CompatVersionUnknown()}}{{CompatVersionUnknown()}}
+
+ +
+ + + + + + + + + + + + + + + + + + + +
機能Firefox Mobile (Gecko)AndroidIE MobileOpera MobileSafari Mobile
基本サポート{{ CompatUnknown() }}{{ CompatUnknown() }}{{ CompatUnknown() }}{{ CompatUnknown() }}{{ CompatUnknown() }}
+
+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf