pyronaur
pyronaur

Reputation: 3545

jQuery click event on iPad not working properly

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

Answers (1)

KoU_warch
KoU_warch

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

Related Questions