WordPress.org

Ready to get started?Download WordPress

Forums

jQuery Responsive Select Menu
[resolved] Suggestion, add dynamic menu classes (7 posts)

  1. Forboding Angel
    Member
    Posted 2 months ago #

    I achieved this by changing line 21 of jrsm-jquery.js to this:

    'class': 'jquery-responsive-select-menu jrsm-' + index,

    the end result is that of course each menu on the page gets a class of .jrsm-#

    Makes it a little easier to target them.

    http://pastebin.com/f3wXcxGg

    https://wordpress.org/plugins/jquery-responsive-select-menu/

  2. Mickey Kay
    Member
    Plugin Author

    Posted 2 months ago #

    Great suggestion. At present, the elements each get a unique name attribute, but adding the class is a great idea.

    Keep your eyes open for an update shortly.

  3. Mickey Kay
    Member
    Plugin Author

    Posted 2 months ago #

    Just added this feature to v1.2. Thanks again for the great suggestion :)

  4. Forboding Angel
    Member
    Posted 2 months ago #

    Awesome! Thanks :-D

    The reason for the class is that with css/scss/sass, you can't target a name (believe me I tried everything I could think of).

    I gather that in jquery you can target elements using their unique name, but I wanted something where I could specifically refer to a single menu out of a bunch on a page.

    For mobile, I prefer to use dropdowns for the menus as they are honestly just plain better experiencewise. The problem is, they are fugly, so I have been messing around with ways to style them up and if you look in the other thread, I posted some screenshots of what I've done with them.

  5. Mickey Kay
    Member
    Plugin Author

    Posted 2 months ago #

    Yeah, I love it. Trust me, we've spent a ton of time styling drop-downs too, and it can be a pain in the you-know-what. What's worse (better really), is that we have a pretty extensive device lab, so there's no excuse for it not to look good :)

    Would love to see any plugin/framework you're working on for styling these guys. Thanks again!

  6. Forboding Angel
    Member
    Posted 2 months ago #

    It's actually straight up scss, pretty simple too.

    Not sure if it works on < IE 11 (and frankly, I don't care), but here is the gist of it.

    http://pastebin.com/jg7SuWsS

    Note: This is styling before I have cleaned anything up and mode it look pretty, so don't be shocked at how fugly it is.

    Normally I would target the select element, but this plugin is interesting in the fact that if I try to target select, I simply can't with any degree of certainty, whereas I can target the .jquery-responsive-select-menu class and make it work, so in the interest of time, that's what I did.

    I'm sure I can probably go back and figure out all of the quirkyness and document it, but at the moment I'm on a schedule, so I don't have time to be screwing around with trying to sort things out. When i have some off time I'll go back and make it better.

  7. Forboding Angel
    Member
    Posted 2 months ago #

    http://pastebin.com/Mmn6xcC9

    Better method using a data uri instead of image for the menu button.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.