mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-12 16:43:10 +00:00
reworked the timing and styles for the pageLoading sequences in attempt to reduce blinky behavior. Small improvements...
This commit is contained in:
parent
1317c57863
commit
c484629e84
2 changed files with 12 additions and 14 deletions
|
|
@ -33,11 +33,10 @@
|
|||
|
||||
/* loading screen */
|
||||
.ui-loading, .ui-loading body { overflow: hidden !important; }
|
||||
.ui-loading .ui-content { visibility: hidden; }
|
||||
.ui-loading .ui-loader { display: block; }
|
||||
.ui-loader { display: none; position: absolute; z-index: 0; top: 100px; left: 50%; width: 100px; margin-left: -80px; padding: 20px 30px; border: 0; }
|
||||
.ui-loader h1 { font-size: 15px; text-align: center; opacity: .8; }
|
||||
.ui-loader .ui-icon { position: static; display: block; opacity: .7; margin: 0 auto; width: 35px; height: 35px; background-color: transparent; }
|
||||
.ui-loader { display: none; position: absolute; opacity: .7; z-index: 10; top: 75px; left: 50%; width: 200px; margin-left: -130px; padding: 20px 30px; }
|
||||
.ui-loader h1 { font-size: 15px; text-align: center; }
|
||||
.ui-loader .ui-icon { position: static; display: block; opacity: .9; margin: 0 auto; width: 35px; height: 35px; background-color: transparent; }
|
||||
|
||||
/*headers, content panels*/
|
||||
.ui-bar, .ui-body { position: relative; padding: .4em 15px; overflow: hidden; display: block; clear:both; }
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
$html = jQuery('html'),
|
||||
$head = jQuery('head'),
|
||||
$body,
|
||||
$loader = jQuery('<div class="ui-loader ui-body-c ui-corner-all fade in"><span class="ui-icon ui-icon-loading spin"></span><h1>loading.</h1></div>'),
|
||||
$loader = jQuery('<div class="ui-loader ui-body-a ui-corner-all"><span class="ui-icon ui-icon-loading spin"></span><h1>loading.</h1></div>'),
|
||||
startPage,
|
||||
startPageId = 'ui-page-start',
|
||||
activePageClass = 'ui-page-active',
|
||||
|
|
@ -42,7 +42,9 @@
|
|||
function hideBrowserChrome() {
|
||||
// prevent scrollstart and scrollstop events
|
||||
jQuery.event.special.scrollstart.enabled = false;
|
||||
window.scrollTo( 0, 0 );
|
||||
setTimeout(function() {
|
||||
window.scrollTo( 0, 0 );
|
||||
},0);
|
||||
setTimeout(function() {
|
||||
jQuery.event.special.scrollstart.enabled = true;
|
||||
}, 150 );
|
||||
|
|
@ -104,22 +106,18 @@
|
|||
return false;
|
||||
});
|
||||
|
||||
// turn on/off page loading message.. also hides the ui-content div
|
||||
// turn on/off page loading message.
|
||||
function pageLoading( done ) {
|
||||
if ( done ) {
|
||||
$html.removeClass( "ui-loading" );
|
||||
//fade in page content, remove loading msg
|
||||
jQuery('.ui-page-active .ui-content').addClass('dissolve in');
|
||||
} else {
|
||||
$loader.appendTo('body');
|
||||
$html.addClass( "ui-loading" );
|
||||
$loader.appendTo( $body ).addClass( "dissolve in" );
|
||||
}
|
||||
};
|
||||
|
||||
// transition between pages - based on transitions from jQtouch
|
||||
function changePage( from, to, transition, back ) {
|
||||
hideBrowserChrome();
|
||||
|
||||
// kill keyboard (thx jQtouch :) )
|
||||
jQuery( document.activeElement ).blur();
|
||||
|
||||
|
|
@ -223,8 +221,6 @@
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
hideBrowserChrome();
|
||||
});
|
||||
|
||||
//add orientation class on flip/resize.
|
||||
|
|
@ -374,4 +370,7 @@
|
|||
jQuery('#eventlogger').prepend('<div>Event fired: '+ e.type +'</div>');
|
||||
});
|
||||
});
|
||||
|
||||
$window.load(hideBrowserChrome);
|
||||
|
||||
})( jQuery, this );
|
||||
|
|
|
|||
Loading…
Reference in a new issue