Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Auto Reposition jQuery Dialogs
//Makes Scroll Checkpoint Dialogs reposition automatically when the window size changes
//Hopefully has a positive influence on mobile devices
$.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