tags:

views:

18

answers:

1

How do I get those values? I see the example on the YUI page to do this but using a click event, and then calling the get('winWidth') method on the event target. But how can I get these values without the use of any event? Thanks

A: 

Simply

YAHOO.util.Dom.getViewportWidth();
YAHOO.util.Dom.getViewportHeight();

keep in mind you can reduce YUI namespace as shown bellow

(function() {
    var Yutil = YAHOO.util,

         Ydom = Ytil.Dom;

    Ydom.getViewportWidth();
    Ydom.getViewportHeight();
})();
Arthur Ronald F D Garcia