mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-02 03:44:43 +00:00
changed setting of lastScroll
This commit is contained in:
parent
97539ed3bd
commit
0d98b8fad6
1 changed files with 8 additions and 6 deletions
|
|
@ -383,7 +383,14 @@
|
|||
$( document ).bind( "beforechangepage", function(){
|
||||
var active = $.mobile.urlHistory.getActive();
|
||||
if( active ){
|
||||
active.lastScroll = $( window ).scrollTop();
|
||||
var lastScroll = $( window ).scrollTop();
|
||||
|
||||
//if the Y location we're scrolling to is less than minScrollBack, let it go for sake of smoothness
|
||||
if( lastScroll < $.mobile.minScrollBack ){
|
||||
lastScroll = $.mobile.defaultHomeScroll;
|
||||
}
|
||||
|
||||
active.lastScroll = lastScroll;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -399,11 +406,6 @@
|
|||
// Scroll to top
|
||||
window.scrollTo( 0, $.mobile.defaultHomeScroll );
|
||||
|
||||
//if the Y location we're scrolling to is less than 10px, let it go for sake of smoothness
|
||||
if( toScroll < $.mobile.minScrollBack ){
|
||||
toScroll = 0;
|
||||
}
|
||||
|
||||
if( fromPage ) {
|
||||
//trigger before show/hide events
|
||||
fromPage.data( "page" )._trigger( "beforehide", null, { nextPage: toPage } );
|
||||
|
|
|
|||
Loading…
Reference in a new issue