Center a webapp in the browser

Hi!

I just want to start my WebApp from the XojoCloud in the center of the browser (horizontel).

But i cant find how?

Thanks!

Andreas

I think you are asking simply about positioning on the webpage. For centering, put all your controls inside a single container control. Then put that container control on the page and use only the top lock leaving both sides unlocked. That will center it in the browser.

Not controls on a webpage.

The webpage in the Browser-window.

At the moment i put the WebApp into an iFrame of an html side. So i am able to center the app in the middle of the browser window.

But maybe it is possible to make it without an iFrame?

Thanks!

Andreas

Do as Kevin suggested and the webpage will be in the center of the browser window.

If the size is fixed place the control without the lock left, top, bottom and right it should stay centered when run

Sorry! My mistake! Now it runs well! Thanks!

Andreas

One more thing.

You wrote “if the size is fixed…”

How can i make webpage, where the size is not fixes. So it starts as maximized for example?

Thanks!

Andreas

[quote=333573:@Andreas Arriens]One more thing.

You wrote “if the size is fixed…”

How can i make webpage, where the size is not fixes. So it starts as maximized for example?

Thanks!

Andreas[/quote]

It will resize but the size you set will be an invisible border unless you lock controls on their top, bottom, left or right.

Otherwise use a containercontrol as suggested. Then lock the container in your webpage

Similar thing - could I add a full-screen button to a web app? (The effect would be like when you full-screen youtube)
thanks.

It’s not going to look the way you think it will, and the command is different for each browser, but here’s the Safari hack:

document.body.webkitRequestFullScreen();

Thanks - unfortunately this leads to more questions, Tim…

If i put that into the “open” code of a canvas the error is “webcanvas has no member named body”

(Also, how woud i get the default browser on user machine? What is the Chrome hack? other browser hacks? )

:slight_smile:

Don’t try to resize the page to fullscreen when the user lands on your webpage.
That’s just as obnoxious as trying to resize the browser window.

Hopefully browsers would block that kind of behavior.

To answer your question I need to know if you changed anything about that line. If you replaced the document part that would be the source of the issue. If you want just the WebCanvas to go fullscreen that is entirely possible, you just have to get the WebCanvas object, something like, document.getElementById('%webcanvas_id%').webkitRequestFullscreen();