Added a new core option called maxTransitionWidth, which defaults to 1000. Accepts any number or false value. If it's not false, the handler will use a "none" transition when the window width is wider than the specified value. This is useful because transitions get very wonky on wider screens.

This commit is contained in:
scottjehl 2012-01-05 18:11:37 +07:00
parent a0c67fa026
commit 518e3ce8cd
2 changed files with 5 additions and 1 deletions

View file

@ -39,6 +39,9 @@ define( [ "jquery.mobile.widget" ], function() {
// Set default page transition - 'none' for no transitions
defaultPageTransition: "fade",
// Set maximum window width for transitions to apply
maxTransitionWidth: 1000,
// Minimum scroll distance that will be remembered when returning to a page
minScrollBack: 250,

View file

@ -13,7 +13,8 @@ function outInTransitionHandler( name, reverse, $to, $from ) {
toScroll = active.lastScroll || ( touchOverflow ? 0 : $.mobile.defaultHomeScroll ),
screenHeight = $.mobile.getScreenHeight(),
viewportClass = "ui-mobile-viewport-transitioning viewport-" + name,
none = !$.support.cssTransitions || !name || name === "none",
maxTransitionOverride = $.mobile.maxTransitionWidth !== false && $( window ).width() > $.mobile.maxTransitionWidth,
none = !$.support.cssTransitions || maxTransitionOverride || !name || name === "none",
doneOut = function() {
if ( $from ) {