Is there a way to move the "reset" mobile alias "Webkit" after clicking on the initial start?

I am working on a site where I use Javascript (via jQuery) to add pop-ups containing additional information for the items in the list. I use jQuery events mouseeneterand mouseleaveso that pop-ups show and disappear, which of course works fine in desktop browsers.

In Mobile Safari, a popup appears when I click on an item (what I expect and what I want), and I added ontouchstartone that fires a mouseleaveJQuery event , thereby hiding the visible popup when the user does something else. This works fine except that when the user removes the item, the popup they just viewed and canceled (either by scrolling or by creating something else that triggers the event ontouchstart), instead of showing pop -up again activates the link attached to this element.

If the user had to click on another element, and not click on the same element, a new popup will appear, and then if they use the first element again, then a popup will appear. Again, this is both expected and what I want.

It would seem that as soon as the element with the hover event was activated, and Mobile Safari, as it was forced to do this event, would be marked as an event related to a hang, and therefore the next answer does not pretend to be a hang, this can be a normal click. Pressing another element with a hover event seems to "reset" with the flag set for the previous element.

I would like this flag to be <reset 'for me, so instead of working at the moment when clicking on an element shows a popup and the next click on this element, even if pop -up was closed, activates the link. instead, when I close the popup with ontouchstart, and therefore, in my opinion, the item no longer freezes, a second click on the same item should show the popup again, and then only click on the item until the popup is displayed if link activated.

The secret would seem to be to get Mobile Safari to exit pseudo-guidance when I use it ontouchstartto launch mouseleave, but I couldn’t find anything useful anywhere else exactly what happens when Mobile Safari claims to freeze over anything, and is it accessible through Javascript events.

I know that I can write a version of my pop-up code to work specifically for Mobile Safari, but it seems to me much more efficient to get the browser to do most of the hard work of emulating hover events. If I could get this final little ring, figured it out.

+5
source share
2

, , , . , - .

, , , .

$('body').focus();
0

tl; dr, :

# :hover fix
# e.g.: body:not(.stoppedhovering) .styled:hover
hoverFix = ->
  window.clearTimeout hoverFix.delay if hoverFix.delay?
  $('body').removeClass 'stoppedhovering'
  delayed = -> $('body').addClass 'stoppedhovering'
  hoverFix.delay = _.delay delayed, 600
$('*').live 'touchstart', hoverFix
0

All Articles