Closed markedwards closed 13 years ago
Mark, could you possibly test to see if this is fixed in the latest branch release?
I am using this version:
http://github.com/Craga89/qTip/blob/master/dist/jquery.qtip.min.js
Is that the latest?
Just to add a note to this -- its not zooming that's causing the issue, its scrolling. If the window is scrolled anything other than full left and top, positioning is off. Zooming is actually irrelevant.
Yep that's the latest. I just updated the code a bit, is this still happening?
Still happening, I'm afraid. This issue is actually an open bug on the jQuery tracker:
http://bugs.jquery.com/ticket/6446
Its listed as happening in iOS 4.0.4, so my guess is Apple fixed this in 4.1, because an iPhone running 4.1 does not have the problem. There is a workaround suggested in the second comment on the bug page (detecting iOS and subtracting window.scroll values from top and left). Kind of ugly, but so is the tooltip rendering on pre-4.1 iOS devices.
Hmm can you test out the latest commit? I expanded the detection to all mobile Safari browsers.
Okay, that's fixed iPad with iOS 3.2.2, but now the iPhone with iOS 4.1 is broken. I think version number detection might be the only way to detect this, unless you have a way to test for the actual problem. My guess is 4.1 is where it was fixed, but again that is a total guess.
Ah my bad I was using >4.1 instead of >4 so it was using the fix on 4.1. Should now be fixed.
Indeed, it works now in my tests. Thanks for giving this attention!
It might be best to address this with a behavioral test rather than a browser detection, as the situation may change (if jQuery addresses this, for instance). Perhaps there is a way to detect this misbehavior? I will post if I come up with anything.
Thanks again.
I made a little progress on this. It does indeed seem to be jQuery-specific. Here is a test page:
http://mark.antsclimbtree.com/files/jquery.ipad-test.php
Clicking the yellow square shows the top and left as calculated by jQuery as well as straight javascript. They should be the same, but on iOS <4.1 they are not if you scroll.
One solution might be to not use jQuery to calculate the top and left.
On an iPad running iOS 3.2.2, if the page is at all zoomed when a tooltip is triggered, it's position is radically incorrect, unless the screen is scrolled all the way top and left. It behaves as if the position of the target assumes the viewport is the page. The tooltip is placed on the page where it would be if the screen were scrolled all the way top and left.
Interestingly, this behavior is correct on an iPhone running iOS 4.1, which suggests that it will change when iPads get the 4.x update. Still, if it is possible to correct this behavior in qTip, I think it makes sense to.