diff --git a/IPython/html/static/notebook/js/widgets/container.js b/IPython/html/static/notebook/js/widgets/container.js
index 56a29c4..9a6c107 100644
--- a/IPython/html/static/notebook/js/widgets/container.js
+++ b/IPython/html/static/notebook/js/widgets/container.js
@@ -120,9 +120,10 @@ define(["notebook/js/widget"], function(widget_manager) {
         show: function() {
             this.$window.show();
             this.$show_button.addClass('btn-info');
-            var position = this.$show_button.offset();
-            this.$window.css('left', position.left + this.$show_button.outerWidth());
-            this.$window.css('top', position.top);
+            this.$window.css("top", Math.max(0, (($(window).height() - this.$window.outerHeight()) / 2) + 
+                                                $(window).scrollTop()) + "px");
+            this.$window.css("left", Math.max(0, (($(window).width() - this.$window.outerWidth()) / 2) + 
+                                                        $(window).scrollLeft()) + "px");
         },
         
         update: function(){