ComputerWolf / SlickNav

Responsive Mobile Menu Plugin for jQuery
MIT License
939 stars 314 forks source link

How to add an extra menu link to the slicknav_menu? #74

Open q2apro opened 9 years ago

q2apro commented 9 years ago

For the mobile menu I need an extra menu item. But not for the desktop view.

I am using a workaround, before calling slicknav I add the link, after slicknav init I remove it again:

$('#nav').prepend('<li><a href="#">Login</a></li>');
$('#nav').slicknav({
    label: '',
    duration: 100,
    prependTo: 'body',
    init: slickbuilt,
});
// remove login link again
$('#nav li:first-child').remove();

Is there any other way to do this?