Hi Thorsten
> No hints for me?
> One way to do this could go this way:
>
> var d = qx.ui.core.ClientDocument.getInstance();
> d.add(window);
> window.addEventListener("appear", function() {
> var left = (d.getClientWidth() - window.getBoxWidth()) / 2;
> var top = (d.getClientHeight() - window.getBoxHeight()) / 2;
> window.setLeft(left < 0 ? 0 : left);
> window.setTop(top < 0 ? 0 : top);
> }
>
> This works in general, but there are missed two things: I do not want to
> center the window above the whole browser screen, we only need the visible
> area. And if the scrollbars are moved down or right I have to add the
> scrolled value.
> But d.getScrollTop() brings up "0" at any point (at least in Firefox).
>
If you are using inline widgets, its not the ClientDocument, which has
the scollbars but the "document.body" you can get the scroll position by
reading "document.body.scrollTop".
Best Fabian
--
Fabian Jakobs
JavaScript Framework Developer
1&1 Internet AG
Brauerstraße 48
76135 Karlsruhe
Amtsgericht Montabaur HRB 6484
Vorstand: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Andreas Gauger,
Thomas Gottschlich, Matthias Greve, Robert Hoffmann, Markus Huhn, Achim Weiss
Aufsichtsratsvorsitzender: Michael Scheeren
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel