File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -89,8 +89,10 @@ Example:
8989``` js
9090// select the menu to manipulate
9191const myMenu = document .getElementById (' my-menu' );
92+
9293// the element that triggers the close event
9394const closeButton = document .getElementById (' close-open-submenus' );
95+
9496// dispatch the custom event when clicking the button
9597closeButton .addEventListener (' click' , () => {
9698 myMenu .dispatchEvent ( new Event ( ' clickyMenusClose' );
@@ -110,7 +112,7 @@ closeButton.addEventListener('click', () => {
110112 < li>< a href= " page-1c.html" > Submenu Item 1c < / a>< / li>
111113 < / ul>
112114 < / li>
113- < -- ! etc… -->
115+ <!-- etc… -->
114116 < / ul>
115117< / nav>
116118` ` `
@@ -128,7 +130,7 @@ Once the script runs, the markup is changed to:
128130 < li>< a href= " page-1c.html" > Submenu Item 1c < / a>< / li>
129131 < / ul>
130132 < / li>
131- < -- ! etc… -->
133+ <!-- etc… -->
132134 < / ul>
133135< / nav>
134136` ` `
You can’t perform that action at this time.
0 commit comments