You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>This example does up and down reordering. This approach can also be used for two-dimensional reordering by adding left and right options.</p>
26
26
<p>The components in this example are list items in an unordered list. Unordered lists are a very good semantic model for sets of similar items, like these components. The menu approach can also be used for other types of groupings.</p>
27
-
<p>The modules are list items, and each module, in addition to content in <codeclass="language-html">div</code> elements, contains a menu represented as a nested list.</p>
28
-
29
-
30
-
<p>Since we've covered the showing and hiding of menus in the simple tree samples, we'll focus here just on the code that swaps the modules. Once we harmonize the events and cancel the default link action, we go to work. First, we set a bunch of local variables for the elements with which we'll be working: the menu, the module to be reordered, the menuLink. Then, after checking the reorder direction, we try to grab the node to swap. If we find one, we then call <codeclass="language-javascript">swapNode()</code> to swap our two modules, and <codeclass="language-javascript">PositionElement()</code> to move the absolutely-positioned menu along with the module, and then set focus back on the menu item which launched the whole thing.</p>
31
-
32
-
33
-
27
+
<p>In this example, the menu is always visible. This is a good approach for components that are not too numerous, as it allows users to see the options without having to open a menu.</p>
34
28
<p>The <abbrtitle="Cascading Style Sheets">CSS</abbr> for swap using buttons is extensive to account for all WCAG accessibility conformance requirements. It includes media queries that adjust the text boxes based on the size of the screen. The example thus conforms to WCAG 2.2 </p>
0 commit comments