<method name="setSpace">
<body>
<![CDATA[
var h = window.innerHeight;
var s = this.getAttribute('space');
this.setAttribute('height',h*s);
]]>
</body>
</method>
and if i call this method from a button it works, but if i call it in
the bindings constructor element ( "this.setSpace()") or in the
window's onload I do not get the correct window. window.innerHeight/
width returns 115X44 which I found to be the window's min. size. It
appears that the constructor and onload try to run before the window
has been fully initialized. I should note that I am trying to run this
on XULRunner and that everything seems to work if i run it in firefox.
Thanks in advanced for any advice guys.
,Sam Hill
>I am trying to use a binding to adjust the height of the bound element according to the window height and a ratio provided.
>
Unless you are setting a fixed window height (<window height="...">),
the height is calculated from the height of the contained elements, thus
making your calculation self-referential... this also explains why the
height isn't set until after onload, since only then is the document
ready for its size to be calculated.
--
Warning: May contain traces of nuts.
var myThis = this;
setTimeout(function(){myThis.setSpace()},1);
Thanks for your response,
Sam Hill