Mobile breakpoint don’t respect units
-
Hi!
I want to set mobile breakpoint in rem.

So menu will work correctly on mobile. This setting goes to this part of your code

Here we lose rem units. And this value “66” goes to maxmegamenu.js where plugin determines whether we in desktop or mobile view.

Because it comparing 66rem (though it doesn’t know it’s rem, it assumes it px) with width value of windows in pixels it gets it all wrong and plugin thinks we in mobile mode!
You have to pass units to data-breakpont and convert this value to px before you proceed your standart logic of isDesktopView function. So plugins won’t break when I want my mobile breakpoint in rem or em.
The topic ‘Mobile breakpoint don’t respect units’ is closed to new replies.