SYNCER

SYNCER

GlobalEventHandlers.onauxclick - ホイールボタンのクリックで発火

公開日:

GlobalEventHandlers.onauxclickは、GlobalEventHandlersのイベントハンドラです。ホイールボタンをクリックした時に発火するイベントハンドラです。

概要

IDL

attribute EventHandler onauxclick;

typedef EventHandlerNonNull? EventHandler;

[TreatNonObjectAsNull]
callback EventHandlerNonNull = any (Event event);

イベント

設定対象オブジェクト説明
HTML elementsMouseEvent

脚注

?

nullable型。値がnullの場合があることを表します。

TreatNonObjectAsNull

属性に代入されるどの値もnullに変換されます。

any

型が決まっていません。

typedef

複数の名称を一括りにしたり、ある名称を意味が分かりやすくするために、別の名称を定義します。

仕様書

https://html.spec.whatwg.org/multipage/webappapis.html#globaleventhandlers

説明

イベントハンドラの設定例です。

JavaScript

// イベントの設定 (onauxclick)
window.onauxclick = function ( event ) {
	// ...
}

// イベントの設定 (addEventListener)
window.addEventListener( "auxclick", function ( event ) {
	// ...
} ) ;

サンプルコード

HTML

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>【デモ】GlobalEventHandlers.onauxclick - ホイールボタンのクリックで発火</title>
		<link rel="canonical" href="https://syncer.jp/Web/API_Interface/Reference/IDL/GlobalEventHandlers/onauxclick/">
		<style>
			body {
				background-color: #fff ;
			}

			.event {
				color: #333 ;
			}

			.event.object {
				color: #008000 ;
			}

			.event.undefined, .event.null {
				color: #666 ;
			}

			.event.string {
				color: #c00 ;
			}

			.event.number {
				color: #00c ;
			}

			.event.boolean {
				color: #c0c ;
			}
		</style>
	</head>
	<body>

<p>ホイールボタンでクリックしてみて下さい。</p>

<hr>

<pre>イベントの発生回数: <span id="count">0</span></pre>

<hr>

<pre><span id="interface"></span>
MouseEvent.screenX: <span class="event"></span>
MouseEvent.screenY: <span class="event"></span>
MouseEvent.clientX: <span class="event"></span>
MouseEvent.clientY: <span class="event"></span>
MouseEvent.ctrlKey: <span class="event"></span>
MouseEvent.shiftKey: <span class="event"></span>
MouseEvent.altKey: <span class="event"></span>
MouseEvent.metaKey: <span class="event"></span>
MouseEvent.button: <span class="event"></span>
MouseEvent.buttons: <span class="event"></span>
MouseEvent.relatedTarget: <span class="event"></span>
MouseEvent.pageX: <span class="event"></span>
MouseEvent.pageY: <span class="event"></span>
MouseEvent.x: <span class="event"></span>
MouseEvent.y: <span class="event"></span>
MouseEvent.offsetX: <span class="event"></span>
MouseEvent.offsetY: <span class="event"></span>
MouseEvent.movementX: <span class="event"></span>
MouseEvent.movementY: <span class="event"></span>
UIEvent.view: <span class="event"></span>
UIEvent.detail: <span class="event"></span>
Event.type: <span class="event"></span>
Event.target: <span class="event"></span>
Event.currentTarget: <span class="event"></span>
Event.eventPhase: <span class="event"></span>
Event.cancelBubble: <span class="event"></span>
Event.bubbles: <span class="event"></span>
Event.cancelable: <span class="event"></span>
Event.defaultPrevented: <span class="event"></span>
Event.composed: <span class="event"></span>
Event.isTrusted: <span class="event"></span>
Event.timeStamp: <span class="event"></span></pre>

<script>
// イベントの発生回数を管理
var count = 0 ;

// イベントの設定
window.onauxclick = function ( event ) {
	// 発生回数のカウント
	document.getElementById( "count" ).textContent = ++count ;

	// 内容の確認
	document.getElementById( "interface" ).textContent = event ;
	console.log( event ) ;

	// プロパティの内容
	for ( var a=[ "screenX", "screenY", "clientX", "clientY", "ctrlKey", "shiftKey", "altKey", "metaKey", "button", "buttons", "relatedTarget", "pageX", "pageY", "x", "y", "offsetX", "offsetY", "movementX", "movementY", "view", "detail", "type", "target", "currentTarget", "eventPhase", "cancelBubble", "bubbles", "cancelable", "defaultPrevented", "composed", "isTrusted", "timeStamp" ], b=document.getElementsByClassName( "event" ), quote, i=0, l=a.length; l>i; i++ ) {
		// プロパティの取得
		var result = event[ a[i] ] ;

		// HTMLの装飾
		quote = (typeof result === "string" ? '"' : "") ;
		b[i].className = "event " + ( result === null ? "null" : typeof result ) ;

		// 結果の確認
		b[i].textContent = quote + result + quote ;
	}
}
</script>

	</body>
</html>

デモを開く

デモ

</head><body>までを含めて下さい。

<body> <div id="___body">

</div> <script>...</script> </body> </html>

<style>

</style>

<script>

</script>

サポート状況

GlobalEventHandlers.onauxclickのサポート状況です。

ブラウザサポート状況ブラウザサポート状況
ChromeSupported 55+FirefoxNot Supported
EdgeNot SupportedInternet ExplorerNot Supported
SafariNot SupportedOperaSupported 42+
iOS SafariNot SupportedAndroidNot Supported

Chrome

バージョンサポート状況公開時期シェア
57Supported2017年3月頃0.1%
56Supported2017年1月頃12.02%
55Supported2016年12月頃12.36%
54Not Supported2016年10月頃0.44%
53Not Supported2016年9月頃0.25%
52Not Supported2016年7月頃0.27%
51Not Supported2016年6月頃0.4%
50Not Supported2016年4月頃0.32%
49Not Supported2016年3月頃0.47%
48Not Supported2016年1月頃0.02%
47Not Supported2015年12月頃0.06%
46Not Supported2015年10月頃0.56%
45Not Supported2015年9月頃0.01%
44Not Supported2015年7月頃0.83%
43Not Supported2015年5月頃0.05%
42Not Supported2015年4月頃0.05%
41Not Supported2015年3月頃0.01%
40Not Supported2015年1月頃0.59%
39Not Supported2014年11月頃0.02%
38Not Supported2014年10月頃0.08%
37Not Supported2014年8月頃0.01%
36Not Supported2014年7月頃0.01%
35Not Supported2014年5月頃0.01%
34Not Supported2014年4月頃0.14%
33Not Supported2014年2月頃0.01%
32Not Supported2014年1月頃0%
31Not Supported2013年11月頃0.01%
30Not Supported2013年10月頃0.03%
29Not Supported2013年8月頃0%
28Not Supported2013年6月頃0.03%
27Not Supported2013年5月頃0.01%
26Not Supported2013年3月頃0%
25Not Supported2013年2月頃0%
24Not Supported2013年1月頃0%
23Not Supported2012年11月頃0%
22Not Supported2012年9月頃0%
21Not Supported2012年7月頃0%
20Not Supported2012年6月頃0%
19Not Supported2012年5月頃0%
18Not Supported2012年3月頃0.01%
17Not Supported2012年2月頃0.01%
16Not Supported2011年12月頃0%
15Not Supported2011年10月頃0%
14Not Supported2011年9月頃0%

Firefox

バージョンサポート状況公開時期シェア
52Not Supported2017年3月頃0.12%
51Not Supported2017年1月頃1.7%
50Not Supported2016年11月頃0.78%
49Not Supported2016年9月頃0.02%
48Not Supported2016年8月頃0.07%
47Not Supported2016年6月頃0.03%
46Not Supported2016年4月頃0.01%
45Not Supported2016年3月頃0.1%
44Not Supported2016年1月頃0.01%
43Not Supported2015年12月頃0.02%
42Not Supported2015年11月頃0.01%
41Not Supported2015年9月頃0%
40Not Supported2015年8月頃0.02%
39Not Supported2015年7月頃0.01%
38Not Supported2015年5月頃0.02%
37Not Supported2015年3月頃0%
36Not Supported2015年2月頃0.01%
35Not Supported2015年1月頃0%
34Not Supported2014年12月頃0.01%
33Not Supported2014年10月頃0%
32Not Supported2014年9月頃0%
31Not Supported2014年7月頃0.01%
30Not Supported2014年6月頃0%
29Not Supported2014年4月頃0%
28Not Supported2014年3月頃0.01%
27Not Supported2014年2月頃0%
26Not Supported2013年12月頃0%
25Not Supported2013年10月頃0%
24Not Supported2013年9月頃0%
23Not Supported2013年8月頃0%
22Not Supported2013年6月頃0%
21Not Supported2013年5月頃0%
20Not Supported2013年4月頃0%
19Not Supported2013年2月頃0%
18Not Supported2013年1月頃0%
17Not Supported2012年11月頃0%
16Not Supported2012年10月頃0%
15Not Supported2012年8月頃0%
14Not Supported2012年7月頃0%
13Not Supported2012年6月頃0%
12Not Supported2012年4月頃0%
11Not Supported2012年3月頃0%
10Not Supported2012年1月頃0%
9Not Supported2011年12月頃0%
8Not Supported2011年11月頃0%
7Not Supported2011年9月頃0%
6Not Supported2011年8月頃0%
5Not Supported2011年6月頃0%
4Not Supported2011年3月頃0%

Edge

バージョンサポート状況公開時期シェア
14Not Supported2016年2月頃1.05%
13Not Supported2015年9月頃0.08%

Internet Explorer

バージョンサポート状況公開時期シェア
11Not Supported2013年10月頃4.99%
10Not Supported2012年8月頃0.09%
9Not Supported2011年3月頃0.18%
8Not Supported2009年3月頃0.04%
7Not Supported2006年10月頃0.01%
6Not Supported2001年8月頃0%

Safari

バージョンサポート状況公開時期シェア
10Not Supported2016年10月頃0%
9.1Not Supported2015年9月頃0%
8.0Not Supported2014年10月頃0%
7.1Not Supported2013年10月頃0%
6.0Not Supported2012年7月頃0%
5.1Not Supported2011年7月頃0%
4Not Supported2009年6月頃0%

Opera

バージョンサポート状況公開時期シェア
43Supported2017年2月頃0.06%
42Supported2016年12月頃0.09%
41調査中…2016年10月頃0.01%
40Not Supported2016年9月頃0%
39Not Supported2016年8月頃0%
38調査中…2016年6月頃0%
37Not Supported2016年5月頃0.01%
36Not Supported2016年3月頃0.01%
35Not Supported2016年2月頃0%
34調査中…2015年12月頃0%
33調査中…2015年10月頃0%
32調査中…2015年9月頃0%
31調査中…2015年8月頃0%
30Not Supported2015年6月頃0%
29調査中…2015年4月頃0%
28Not Supported2015年3月頃0%
27Not Supported2015年1月頃0%
26調査中…2014年12月頃0%
25Not Supported2014年10月頃0%
24Not Supported2014年9月頃0%
23調査中…2014年7月頃0%
22Not Supported2014年6月頃0%
21Not Supported2014年5月頃0.01%
20Not Supported2014年3月頃0%
19Not Supported2014年1月頃0%
18Not Supported2013年11月頃0%
17調査中…2013年10月頃0%
16調査中…2013年8月頃0%
15Not Supported2013年7月頃0%
12Not Supported2012年6月頃0.02%
11.6Not Supported2011年12月頃0%
11.1Not Supported2011年4月頃0%

iOS Safari

バージョンサポート状況公開時期シェア
10.0Not Supported2016年9月頃39.65%
9.1Not Supported2015年9月頃5.39%
8.3Not Supported2014年9月頃1.03%
7.0Not Supported2013年9月頃0.24%
6.0Not Supported2012年9月頃0.05%
5.1Not Supported2011年10月頃0.03%

Android

バージョンサポート状況公開時期シェア
4.4Not Supported2013年10月頃0%
4.3Not Supported2013年7月頃0%
4.2Not Supported2013年3月頃0.03%
4.1Not Supported2012年12月頃0%
4.0Not Supported2012年6月頃1.61%
2.3Not Supported2011年10月頃0%