popup positioning

61 views
Skip to first unread message

Rhys Brett-Bowen

unread,
May 15, 2012, 5:14:31 PM5/15/12
to Closure Library Discuss
I'm trying to position a popup so it is underneath the anchor element
and their middles align. I can only see positions for corners in
goog.positioning

what is the recommended way to have their middles align?

Kyaw

unread,
May 16, 2012, 10:17:18 PM5/16/12
to closure-lib...@googlegroups.com
I am interested that question too. I think Gmail popup message is position in that way. 

Rhys Brett-Bowen

unread,
May 29, 2012, 2:55:55 PM5/29/12
to Closure Library Discuss
just need to change the reposition method in popupbase.js to something
like:

reposition = function() {
var box = goog.style.getBounds(this.anchorElement_);
goog.style.setPageOffset(this.getElement(),
box.left - (this.width - box.width) / 2,
box.top + box.height);
};

works for simple cases
Reply all
Reply to author
Forward
0 new messages