mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
added minScrollBack feature to core options. This is the minimum scroll distance that will be jumped-to when returning to a page. By default, the distance is screen.height /2. If you really needed to disable scroll memory altogether, this could be set to Infinity. Note that disabling scroll memory altogether is almost never a good idea for usability, but the option is there.
This commit is contained in:
parent
3bd713c185
commit
fcbfc2f380
3 changed files with 8 additions and 2 deletions
|
|
@ -103,6 +103,9 @@ $(document).bind("mobileinit", function(){
|
|||
|
||||
<dt>defaultDialogTransition (<em>string</em>, default: 'pop'):</dt>
|
||||
<dd>Set the default transition for dialog changes that use Ajax. Set to 'none' for no transitions by default.</dd>
|
||||
|
||||
<dt>minScrollBack (<em>string</em>, default: 150):</dt>
|
||||
<dd>Minimum scroll distance that will be remembered when returning to a page. </dd>
|
||||
|
||||
<dt>loadingMessage (<em>string</em>, default: "loading"):</dt>
|
||||
<dd>Set the text that appears when a page is loading. If set to false, the message will not appear at all.</dd>
|
||||
|
|
|
|||
|
|
@ -38,6 +38,9 @@
|
|||
|
||||
//set default page transition - 'none' for no transitions
|
||||
defaultPageTransition: "slide",
|
||||
|
||||
//minimum scroll distance that will be remembered when returning to a page
|
||||
minScrollBack: screen.height / 2,
|
||||
|
||||
//set default dialog transition - 'none' for no transitions
|
||||
defaultDialogTransition: "pop",
|
||||
|
|
|
|||
|
|
@ -396,7 +396,7 @@
|
|||
}
|
||||
|
||||
//if the Y location we're scrolling to is less than 10px, let it go for sake of smoothness
|
||||
if( toScroll < 20 ){
|
||||
if( toScroll < $.mobile.minScrollBack ){
|
||||
toScroll = 0;
|
||||
}
|
||||
|
||||
|
|
@ -453,7 +453,7 @@
|
|||
|
||||
//simply set the active page's minimum height to screen height, depending on orientation
|
||||
function resetActivePageHeight(){
|
||||
var height = jQuery.event.special.orientationchange.orientation() == "portrait" ? screen.height : screen.width,
|
||||
var height = jQuery.event.special.orientationchange.orientation() === "portrait" ? screen.height : screen.width,
|
||||
winHeight = $( window ).height(),
|
||||
pageMin = Math.min( height, winHeight );
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue