Permalink
Browse files

bugfix for issue #1673, using helper function from previous bugfix fo…

…r issue #455
  • Loading branch information...
1 parent 7e0a58e commit 08e71fbc21174f10acfebd211f0846358fd54209 Tobias Bosch committed Jun 4, 2011
Showing with 8 additions and 1 deletion.
  1. +8 −1 js/jquery.mobile.core.js
View
9 js/jquery.mobile.core.js
@@ -93,7 +93,14 @@
//scroll page vertically: scroll to 0 to hide iOS address bar, or pass a Y value
silentScroll: function( ypos ) {
- ypos = ypos || 0;
+ if (typeof ypos != 'number') {
+ // Sometimes this functions gets an argument which is no number at all...
+ ypos = 0;
+ }
+ if (ypos==0 && $.mobile.browser.android) {
+ // on Android we need ypos=1 to hide the addressbar
+ ypos = 1;
+ }
// prevent scrollstart and scrollstop events
$.event.special.scrollstart.enabled = false;

2 comments on commit 08e71fb

@scottjehl

Thanks Tigbro! I wonder if we might try always going to 1, and possibly adjusting the page CSS to accommodate that flexibly. Then we could avoid this sort of forking. Thoughts on that?

@tbosch
Owner

Hi Scott,
mmh, could work. If you could set the top property to -1...
Sure, would be better without the check for the user agent...

By the way, are you working on a solution to hide the address bar even if the page is small? In that case the scrolling does not work at all (neither iOS nor android).

Tobias

Please sign in to comment.