vegUI.org home of the javascript based window manager and AJAX framework

vegUI Tutorial 19 - Using vegUI on a generic website

written by vegu on 08 Jan, 2007 07:17:01
vegUI elements can only exist within the HTML node that is controlled by the Manager element. That isn't very efficient if you want to use vegUI on a generic (in other words, not-web-application) website.

But this is a problem we can simply move around.

Instead of building the Manager node yourself you just have it control the body node of the page. You do this calling the manager's control method. The control method lets the vegUI element take control of any existing HTML node in the document.

Code: Javascript
Manager.control(document.body);


Now, for this to work the body node needs to actually exist, so make sure you call this after the body tag or even better when the page is done loading.

Additionally you want to set the ADJUST_BODY_SIZE variable to false somewhere in your script. If true the body node is resized to make sure its proportions "cover" any absolute positioned vegUI elements. Since were now using vegUI on a generic web-page that contains static or relative positioned elements we do not want this feature, and if you leave it on you will have some funky results :)

Related Posts


Your Comment

name:*
email-address:

Are you human?



Comments

No comments yet.