I want to display the menu list from the beginning in the drop-down jquery [Slimmenu] for smartphones.

Asked 2 years ago, Updated 2 years ago, 51 views

This is a jquery where you can have a drop-down menu for smartphones.
http://adnantopal.github.io/slimmenu/

If the width is less than or equal to the set width, the side-by-side menu will be changed to one smartphone menu button with three horizontal lines, and when you click on it, the menu list will appear.

I would like to make the menu list appear from the beginning without turning on the menu button for smartphones on the 3 horizontal lines.(Each menu click will bring up the lower menu, etc.)

The same question is asked at home, but there is no answer.
*This is my first post, so I can't post more than two links.

jquery

2022-09-30 15:36

1 Answers

There is no corresponding item in the option, so I think it is not possible with the standard function.
If it is okay to edit jquery.slimmenu.js itself, I think I can correct it below.

!Notes
MIT license, so there should be no problem, but please take responsibility for the modifications (including the operation guarantee after the modification).
一応 I think you should reconfirm the license just in case.

per L.35

$collapser='<div class="menu-collapser">'+$options.collapserTitle+'<div class="collapse-button">>span class="icon-bar">>/span>span>span>-class="icon-bar"icon-bar">span>span>span>span>span>span>span>>&

Set to ↓ (remove smartphone menu button)

$collapser='<div class="menu-collapser">'+$options.collapserTitle+'</div>',

L.62 to 66

$menu_collapser.on('click','.collapse-button', function(e)
{
    e.preventDefault();
    $menu.slideToggle($options.animSpeed,$options.easingEffect);
});

I don't use , so I delete it (it's a menu button event, so there's no problem if I don't delete it)

Per L.112

$menu.addClass('collapsed').hide();

Make ↓ (do not hide first tier menu)

$menu.addClass('collapsed');


2022-09-30 15:36

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.