Reputation: 3545
The click event should work fine:
subMenu = $(".sub-menu")
//....
subMenu.show()
$("a.mobile").click (e) ->
menuContainer.toggle()
e.preventDefault()
This should toggle the menu on click/tap. The weird thing is that it does it just fine for the first open and close. Starting with the second time, to open, I have to click "a.mobile" twice. I've tried bind, and a bunch of other options. The CSS is actually displaying the link as it were hovered when it's not double-tapped.
Upvotes: 2
Views: 1714
Reputation: 2150
I'm not 100% sure about .click() function, however i use .on('click') for handle events on my application and it works everywhere (including IPads
). Nevertheless as suggested by the comments, perhaps there is something elsewhere preventing the click to work as you expect.
Upvotes: 1