Search code examples
javascripthtmlmootools

MooTools getSize(); not correct values in Chrome or Safari


I have problem- when i run code getSize().y return 488 after reload page, i get 146. Always i get 488 or 146, 488 is correct value , but it in random order with 146 whats wrong with it?

    window.addEvent('domready', function() {


        alert($$("section")[0].getSize().y);

    });

Solution

  • Ok. I just replace domready event with load event. And now thats works correctly always returns 488.

     window.addEvent('load', function() {
    
    
            alert($$("section")[0].getSize().y);
    
        });