Window Height Issue
Hey Guys, loved the idea of Titanium when I first read about it, dived right in and thought it was great I could use my own IDE + Titanium Developer. Since I started some very basic tests, I have been getting totally stumped by a number of seemingly minor problems compounded by lack of examples and tutorials (desktop).
Here's a quick example.
<html>
<head>
<script>
window.onload = function()
{
var window = Titanium.UI.getCurrentWindow;
window.setHeight(300); // Set the window height to 300 pixels.
}
</script>
</head>
<body>Hello</body>
</html>
The code above is pulled straight out of the docs (http://developer.appcelerator.com/apidoc/desktop/latest/Titanium-module) and should just set the window height when the program compiles.
When compiled however, the webkit inspector says "TypeError: Result of expression 'window.height' [undefined] is not a function."
On another note, none of the KitchenSinkDesktop examples for notifications work and result in similar errors, but thats for another post.
I could be totally missing something though, so please feel free to point out what it could be. Tested this on Windows 7 32bit and 64bit.
Thanks,
David.
3 Answers
-
window.height is not a function, it's a property… try window.height = 300;
-
i think it should be windows.height = 300;
-
what if one wants to re-size the window smoothly using jquery effects ?!