Difference between revisions of "Template:HSNU-TAIPEI/js/nav"
(Created page with "<html> <script> var menu = document.getElementById('main-menu'), showLeft = document.getElementsByClassName('showLeft'), body = document.body; showLeft[0].onclick = fu...") |
|||
Line 2: | Line 2: | ||
<script> | <script> | ||
− | var menu = | + | var menu = $("#main-menu"), |
− | showLeft = | + | showLeft = $(".showLeft"), |
− | + | menuButton = $(".menu-button"); | |
+ | function toggleMenu() { | ||
+ | menu.toggleClass("slide-menu-open"); | ||
+ | menuButton.toggle(); | ||
+ | } | ||
− | showLeft | + | showLeft.click(toggleMenu); |
− | + | ||
− | + | ||
</script> | </script> | ||
</html> | </html> |
Revision as of 12:49, 3 April 2015