Skip to content

Instantly share code, notes, and snippets.

@sevenspark
Created August 10, 2011 00:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sevenspark/1135691 to your computer and use it in GitHub Desktop.
Save sevenspark/1135691 to your computer and use it in GitHub Desktop.
Auto Reposition jQuery Dialogs
//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