Created
August 10, 2011 00:51
-
-
Save sevenspark/1135691 to your computer and use it in GitHub Desktop.
Auto Reposition jQuery Dialogs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Makes Scroll Checkpoint Dialogs reposition automatically when the window size changes | |
//Hopefully has a positive influence on mobile devices | |
jQuery(document).ready(function($){ | |
$.ui.dialog.prototype.options.autoReposition = true; | |
$( window ).resize(function() { | |
$( ".ui-dialog-content:visible" ).each(function() { | |
var dialog = $( this ).data( "dialog" ); | |
if ( dialog.options.autoReposition ) { | |
dialog.option( "position", dialog.options.position ); | |
} | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment