Skip to content

Commit c83f8ae

Browse files
committed
Explain example 1 + add example 2
1 parent ec7dcba commit c83f8ae

1 file changed

Lines changed: 34 additions & 6 deletions

File tree

ex2.html

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@
33
<meta charset="UTF-8">
44
<meta name="viewport" content="width=device-width, initial-scale=1.0">
55
<title>Menu Elements Test Page</title>
6-
7-
<style>
8-
body {
9-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
10-
}
116

7+
<style>
128
menuitem {
139
justify-content: space-between;
1410
padding: 6px 10px;
@@ -21,6 +17,27 @@
2117
</style>
2218

2319
<h1>Menu Element Test Page</h1>
20+
<section>
21+
<h2>Menubar with Submenus</h2>
22+
<p>This is a horizontal menubar containing several top-level submenus (File, Edit, View, Help). Clicking these opens a dropdown list of menu items.</p>
23+
24+
<h3>Nested Submenus</h3>
25+
<p>The "File" menu contains an "Open Recent" submenu, and the "View" menu contains a "Zoom" submenu. These should open secondary dropdown lists when activated.</p>
26+
27+
<h3>Disabled Menu Items</h3>
28+
<p>The "File" menu contains a disabled "Print" item, and the "View" menu contains a disabled but checked "Show Comments" item.</p>
29+
30+
<h3>Single Checkable Items (Radio behavior)</h3>
31+
<p>The "Zoom" submenu under "View" has mutually exclusive options. Like radio buttons, checking one should deselect all others. '100%' is initially checked.
32+
</p>
33+
34+
<h3>Multiple Checkable Items (Checkbox behavior)</h3>
35+
<p>The last three items in the "View" menu are checkable. They should behave like checkboxes where multiple items can be toggled on or off independently, except for the aforementioned "Show Comments", which is checked by default and not modifiable by the user.</p>
36+
37+
<h3>Separators</h3>
38+
<p>Some menus use horizontal lines (<code>&lt;hr&gt;</code> elements) to visually group related items. There are 2 separators in the "File" menu, 1 in the "Open Recent" submenu, 1 in the "Edit" menu, and 1 in the "View" menu.</p>
39+
40+
<p>Without further ado:</p>
2441

2542
<menubar>
2643
<!-- File Menu -->
@@ -97,8 +114,19 @@ <h1>Menu Element Test Page</h1>
97114
</menulist>
98115
</submenu>
99116
</menubar>
117+
</section>
118+
119+
<section>
120+
<h2>Menu Button</h2>
121+
<p>This is a standalone button that triggers a menulist popover. It does not use a <code>&lt;menubar&gt;</code>.</p>
100122

101-
<p>This is the main content of the application. The menu above should be fully interactive.</p>
123+
<button command="toggle-popover" commandfor="actions-menu">Actions</button>
124+
<menulist id="actions-menu">
125+
<menuitem>Reply</menuitem>
126+
<menuitem>Forward</menuitem>
127+
<menuitem>Delete</menuitem>
128+
</menulist>
129+
</section>
102130

103131
<script>
104132
const supported = 'HTMLMenuListElement' in window;

0 commit comments

Comments
 (0)