Popup positioning

5 views
Skip to first unread message

toObZz!

unread,
Jun 16, 2009, 4:58:18 AM6/16/09
to ModalBox
Is there any way that the popup can appear at the center of the screen
instead of top?

Justinas Urbanavicius

unread,
Jun 16, 2009, 6:05:07 AM6/16/09
to moda...@googlegroups.com
I think there is not. You could do a work around by setting the top and left properties of modalbox div, before it is shown.

toObZz!

unread,
Jun 17, 2009, 7:48:33 AM6/17/09
to ModalBox
Thanks for your reply. This is how it worked...I found it in some
blog.
//BEFORE:

// _setPosition: function () {
// $(this.MBwindow).setStyle({left: Math.round((Element.getWidth
(document.body) - Element.getWidth(this.MBwindow)) / 2 ) + "px"});
// },

//AFTER:
_setPosition: function() {
$(this.MBwindow).setStyle({ top: "250px", left: Math.round
((Element.getWidth(document.body) - Element.getWidth(this.MBwindow)) /
2) + "px" });
},
> > instead of top?- Hide quoted text -
>
> - Show quoted text -

E. Wayne Madison

unread,
Jun 17, 2009, 8:17:27 AM6/17/09
to moda...@googlegroups.com
Well Done!

--- On Wed, 6/17/09, toObZz! <too...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages