Permalink
5 comments
on commit
sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Mobile WebKit browsers don't support accessing the scroll position of…
… the document/window.
- Loading branch information
Showing
1 changed file
with
28 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dab1d74
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wonder if this is the issue of what it considers the scrolling element. Like for example some Opera versions dig the body for scrolling others dig the docEl
dab1d74
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jdalton: Doesn't appear to be. Searching around the 'net yields no known solution (including a Scriptaculous ticket that's been open since '07). Naturally, if a solution is known it would be greatly appreciated.
dab1d74
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, don't know the details, but
window.scrollX
/window.scrollY
worked for me on iPhone (real device) to read current position of 'viewport' (ok, it is not the same thing as scroll position in classic html page, but can be treated as it if you need to simulate position:fixed on mobile safari).dab1d74
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@darwin: I did some additional testing. It looks like those properties work on the iPhone when you manually scroll - but not on the Palm Pre. And if you call window.scrollTo(200, 200); window.scrollX and window.scrollY will still be 0. I'll see if I can check into some other workarounds but this will be a real bear to unit test.
dab1d74
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeresig: yep, window.scrollTo() not working does not surprise me. Because on mobile safari you have the notion of "viewport" which is decoupled from classic document scrolling. Document scrolling has no effect because page thinks window size is equal to rendered document size. But viewport may be smaller and floats on top of the document/window. What about setting
window.scrollY = 200;
?