English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Wenn ein Element mit dem Attribut contextmenu das Ereignis contextmenu auslöst oder auf das Element bubbling, wird das Ereignis show ausgelöst.
Wird JavaScript ausgeführt, wenn das <menu>-Element im Kontextmenü angezeigt wird:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Grund教程(oldtoolbag.com)</title> </head> <body> <div contextmenu="test"></div> <menu type="context" id="test"> <menuitem label="alert" onclick="alert('der Alert-Label wurde geklickt');" /> </menu> <script> document.getElementById("test").addEventListener("show", function(e){ alert("the context menu will be displayed"); }, false); </script> </body> </html>Test and see ‹/›
The onshow attribute is activated when the <menu> element is displayed as a context menu.
IEFirefoxOperaChromeSafari
Currently, only the onshow event attribute is supported by the browser firefox.
The onshow event attribute is a feature of HTML5new features added.
<element onshow="script">
Value | Description |
---|---|
script | The script is executed in onshow |
Supported HTML Tags: | <menu> |
---|
HTML DOM Reference Manual: onshow Event