AustinC AustinC - 1 year ago 110
CSS Question

jquery on tap fails to change tooltip location in mobile safari

I have a page with some tooltips that are triggered by mousemove. On mobile, you can tap in the appropriate place to see a tooltip, but then there's no way to get rid of it - it just hangs around. I want them to be able to tap anywhere to discard it. So I tried this:

$('#tooltip').css("top", -9999);

Which does... nothing. I have tried a number of variations on this but it bugs me because I feel like this should work. What am I missing?

Here's a fiddle:

The behavior I want is: mobile user taps on area to see tooltip, then taps anywhere to clear the tooltip.

Answer Source

So this is something to do with jquery - I have no idea what. Anyways, this works:

    $('#tooltip').css("top", -9999);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download