Браузеры
Firefox для создания меню поддерживает нестандартный тег <menuitem>.
| Internet Explorer | Chrome | Opera | Safari | Firefox | Android | iOS |
| 8.0+ |
| HTML: | 3.2 | 4.01 | 5.0 | XHTML: | 1.0 | 1.1 |
Устанавливает контекстное меню для элемента.
contextmenu="идентификатор"
В качестве значения указывается идентификатор меню, созданного с помощью тега <menu>.
Нет.
<a>, <abbr>, <address>, <area>, <b>, <bdo>, <blockquote>, <body>, <button>, <caption>, <cite>, <code>, <col>, <colgroup>, <dd>, <del>, <dfn>, <div>, <dl>, <dt>, <em>, <embed>, <fieldset>, <form>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <i>, <iframe>, <img>, <input>, <ins>, <kbd>, <label>, <legend>, <li>, <map>, <menu>, <ol>, <option>, <p>, <pre>, <q>, <s>, <samp>, <select>, <span>, <strong>, <sub>, <sup>, <table>, <tbody>, <td>, <textarea>, <tfoot>, <th>, <thead>, <tr>, <ul>, <var>
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>contextmenu</title> </head> <body> <p><img src="images/figure.jpg" alt="" contextmenu="edit"></p> <menu type="context" id="edit"> <li>Вырезать</li> <li>Копировать</li> <li>Вставить</li> <li>Редактировать</li> <li>Выравнивание</li> </menu> </body> </html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>contextmenu</title>
<style>
.rotateleft {
transform: rotate(-90deg);
}
.rotateright {
transform: rotate(90deg);
}
</style>
<script>
function rotateLeft() {
document.querySelector("img").classList.toggle("rotateleft");
}
function rotateRight() {
document.querySelector("img").classList.toggle("rotateright");
}
</script>
</head>
<body>
<img src="images/figure.jpg" alt="" contextmenu="edit">
<menu type="context" id="edit">
<menuitem icon="images/object-rotate-right.png"
onclick="rotateRight()">Повернуть на 90º ПЧС</menuitem>
<menuitem icon="images/object-rotate-left.png"
onclick="rotateLeft()">Повернуть на 90º ПрЧС</menuitem>
</menu>
</body>
</html>
Firefox для создания меню поддерживает нестандартный тег <menuitem>.
Сайт