SlickNav icon indicating copy to clipboard operation
SlickNav copied to clipboard

How to add an extra menu link to the slicknav_menu?

Open q2apro opened this issue 10 years ago • 0 comments

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?

q2apro avatar Mar 27 '15 19:03 q2apro