ajlkn / jquery.dropotron

Adds multilevel dropdown menus to jQuery.
132 stars 61 forks source link

Touchscreen / click to open #3

Closed nathobson closed 9 years ago

nathobson commented 10 years ago

Hi!

I've been using Dropotron successfully for a while now, love it – great work.

However, I've got a client who works with a Microsoft Surface tablet (v2 to be specific). He's saying that on touch devices, the dropdowns don't work too well. Usually, for tablets, I'd use a different mobile friendly nav. However, as the surface is a 10.6" tablet, it's getting a desktop view. I guess there's also quite a few touchscreen laptops out there which would represent a similar use-case.

I thought about switching over to expandMode: 'click' to help mitigate this. However, when I use this option, no dropdown appears at all. I've also tried downloading the demo project and adding this option, which also doen't work.

Any ideas or am I perhaps missing something?

ajlkn commented 10 years ago

Probably a bug. Dropotron attempts to make some adjustments based on whether the user's on a touch or non-touch device, but I'm guessing it doesn't take into account situations where both apply. I'll check it out.

JonesfromHan commented 10 years ago

I also got this bug on a touchscreen device until I realized that this only happens if I put a # in the a tag of the Dropdown menu. For instance: <a href="#">Login</a> does not work, but <a href="">Login</a> does. I hope, this helps. Regards, Jonas

nathobson commented 10 years ago

Hi Jonas.

You are absolutely correct. It did make it a bit of a pain for WordPress integration (as you can't add in a blank link/placeholder using the in-built menu system) but I've added a class to the top-level items with child pages and then used a quick bit of JS to strip the # link from just those links.

Maybe something could be added to the documentation as it wasn't particularly clear to me and it sounds like you had the same problem?

Thanks, Nat

ajlkn commented 9 years ago

Fixed in 1.4.3.