Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Multiple Instances of ResponsiveMultiLevelMenu with unique trigger ID's #27

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

native-apps
Copy link

I would assume the best option (i may be wrong here) to have is another Option called something like triggerClassName (or ID) to trigger a target menu when using multiple instances of the plugin. Trigger should be able to work from outside of the menu container for the sake of better layout control. The reason for removing the button outside of the menu is so the menu can have a width that is separate from the button & container.

// assign the name of the trigger class
    $( '#dl-menu-2' ).dlmenu({
         animationClasses : { classin : 'dl-animate-in-2', classout : 'dl-animate-out-2' },
         backLabel: 'Back',
         useActiveItemAsLink: true,
         triggerClassName: 'dl-trigger-2'
      });    

This addition was added to the script so multiple instances could be used : #7

screen shot 2015-05-29 at 3 23 54 pm
screen shot 2015-05-29 at 3 23 28 pm

The reason for this request to have the trigger outside of the menu is for better control over the menu width. As you can see in this screenshot is during the animation the menu is displaying the width of the container (which is determined by how many characters are in the label).
screen shot 2015-05-29 at 3 27 10 pm 1

The overall objective is to use multiple menus, and have the buttons to display inline without affecting the width of the menus. Currently the way that the trigger button is inside the container, overlapping would not work due to z-indexing issues. Currently i've achieved a temporary fix by setting a no-wrap overflow style to the container and a fixed-width to the menus which works, but you can see the menu showing a more narrow width that reflects the width of the button-trigger during animation. Also, in mobile mode, the menus are set to 100% width, but the triggers had to be absolutely positioned to be clickable, but it runs into more z-indexing issues. Relative positioning would be much more ideal.

These next two screenshots are Mobile view, and the menus are set to full-width 100% so there is no problem with the width during the animation. Also, the button were positioned absolutely for now, but relative would be ideal and can be accomplished once the buttons are working from outside the container.

screen shot 2015-05-29 at 3 35 38 pm
screen shot 2015-05-29 at 3 35 35 pm

@rejas
Copy link
Contributor

rejas commented May 30, 2015

MIght be too much in this pull request, you seem to have put all my fork-modifications in it. Lets ask the other way round: Whats missing in my fork?

@native-apps
Copy link
Author

native-apps commented Sep 6, 2016

Considering forking this & converting this to a Polymer Element to avoid this multiple instance conflict. i will post the link if I the conversion is successful.

@rejas rejas deleted the branch codrops:master January 30, 2021 14:57
@rejas rejas deleted the master branch January 30, 2021 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants