soundasleep / jquery-dropdown

Bootstrap-style dropdowns with some added features and no dependencies.
Other
767 stars 268 forks source link

Page with menu canvas #121

Closed kamov closed 7 years ago

kamov commented 7 years ago

Hi, I am using http://mmenu.frebsite.nl/ on my site, and when menu is open per default (in large screen), then dropdown appear on right side.

Any idea how to fix this?

screen shot 2017-03-10 at 10 11 06

Thanks!

claviska commented 7 years ago

Please post a minimal example or a Fiddle, otherwise we're just speculating :)

kamov commented 7 years ago

Sure, I make here an example page xxx

You should resize browser more than 1200px, so sidebar menu is open

Thanks for checking!

pallxk commented 7 years ago

Adding class jq-dropdown-relative to your jq-dropdown solves it.

Though I'm not sure if current behavior is expected as the document says

To position a jq-dropdown relative to its parent (as opposed to the document), add the jq-dropdown-relative class to the jq-dropdown container.

But I found that whether jq-dropdown-relative is specified, jq-dropdown is always positioned against the closest ancestor element that is positioned.

The difference is that if jq-dropdown-relative is specified, the position is calculated as related to the closest positioned ancestor, which matches the positioning logic;

while if that's not specified, the position is calculated as related to the document, which may be inconsistent with the positioning logic, if the closest positioned ancestor is not the document.

kamov commented 7 years ago

Thanks!! That solved the issue... I am not sure why I don't find it when I looked in documentation...

The difference is that if jq-dropdown-relative is specified, the position is calculated as related to the closest positioned ancestor, which matches the positioning logic; while if that's not specified, the position is calculated as related to the document, which may be inconsistent with the positioning logic, if the closest positioned ancestor is not the document.

I understand, that make sense.