Skip to content

Instantly share code, notes, and snippets.

@robworley
Created May 21, 2010 14:59
Show Gist options
  • Save robworley/408940 to your computer and use it in GitHub Desktop.
Save robworley/408940 to your computer and use it in GitHub Desktop.
(function($) {
// Monkey patch jQuery-UI 1.8.1 so IE retains scroll position when opening a dialog.
var oldDialogOpen = $.ui.dialog.prototype.open;
$.ui.dialog.prototype.open = function() {
var originalScrollTop = $(window).scrollTop(),
result = oldDialogOpen.apply(this, arguments);
$(window).scrollTop(originalScrollTop);
};
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment