Closed GoogleCodeExporter closed 8 years ago
Well, you can close this one. It's a bug in jQuery.
http://forum.jquery.com/topic/offset-returns-incorrect-values-in-ipad
http://dev.jquery.com/ticket/6446
Original comment by jnou...@gmail.com
on 3 Jun 2010 at 5:40
Thanks for the update :)
I was going to say that I would try to fix the problem if you could somehow
send me
an iPad for testing but it sounds like someone will find a solution in jQuery
itself...
Original comment by kelvin.l...@gmail.com
on 4 Jun 2010 at 7:23
I've implemented a workaround for the time being that makes the calendars
usable on iPads.
I replaced line 769:
var eleOffset = $ele.offset();
with:
var eleOffset = null;
if( /webkit.*mobile/i.test(navigator.userAgent) ) {
eleOffset = $ele.position();
} else {
eleOffset = $ele.offset();
}
By using position() instead, the calendar is placed directly centered on the
button, rather than immediately below it, but that's fine for my
purposes. The other fix noted in the links from my previous comment was to
subtract window.scroll{X|Y} from the offset, but since the
problem does not affect iPhones/iPod touches (and I didn't want to compare the
user agent strings and fix the regex to work only on the
iPad), that would cause the calendars to be mispositioned on those instead.
Original comment by jnou...@gmail.com
on 4 Jun 2010 at 2:39
Original issue reported on code.google.com by
jnou...@gmail.com
on 1 Jun 2010 at 5:53Attachments: