lukaszfiszer / selectnav.js

Responsive drop-down menu for mobiles and small screen devices. Lightweight (1.5kb) and library agnostic
http://lukaszfiszer.github.com/selectnav.js/
MIT License
276 stars 101 forks source link

Add the classes of the original li #2

Open Jogai opened 12 years ago

Jogai commented 12 years ago

I'm experimenting with this navigation in a responsive layout. Is it possible to copy the classes of the li's to the select items? And if it is, can you point me in the right direction?

lukaszfiszer commented 12 years ago

Selectnav uses classes of <li> only to set the active item of <select> - classes are not copied. However, I might consider adding this feature - could you point me what exactly do you want to achieve?

lukaszfiszer commented 11 years ago

This might be an interesting feature to develop, so I leave this issue open and tagged

jomoweb commented 10 years ago

Thank you very much for making this plugin. I think it is outstanding.

I'd absolutely love this enhancement. I am making a site that has a huge amount of third level links. I'd like to hide those in selectnav for sheer size. I figured out an easy way to do that with jQuery, but css would be ideal to give us a lot of flexibility to show/hide or advanced styling.

If anyone is looking for hiding 2nd or 3rd level nav, this is how I did it.

    selectnav('nav', {
        label: 'Menu',
        nested: true,
        autoselect: false,
        activeclass: false,
        indent: '-'
    });
    // I'm using hypens as the indenter, so options that contain 2 are tertiary items
    var navTertiaryOptions = $(".selectnav option:contains('-- ')");
    navTertiaryOptions.remove();