简体   繁体   中英

How to open a menu link through an external button?

I want to open a menu through an external button:

http://jsfiddle.net/kJKq6/10/

The button can't be arranged within the html code of the menu. Im new at html and Javascript/Jquery and don't know the solution, please can anyone help? Many Greetings

<button type="button">THIS BUTTON SHALL TRIGGER THE A LINK WHICH OPENS THE MENU</button>

To stick with your current syntax:

Insert a newline at line 16 of the javascript file and insert:

$('button').on('click', function () { $('.nav li').toggleClass("open"); });

This code will cause the button to toggle the list on and off on each click.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM