Muller Posted July 11, 2011 Posted July 11, 2011 Ok, quite a weird problem I have here.I inserted the following code into footer.tpl: {literal} [removed] window.ready = changeHeight(); function changeHeight() { // document.getElementById("center_column").style.height = "100px"; var height = screen.height; alert("Height is: " + height); document.getElementById("center_column").style.height = screen.height; } [removed] {/literal} What happens if that I get an alert saying "Height is 1200" which is correct for my screen, but the center column's height does not change. On the other hand, if I uncomment the line that statically sets the height to 100 pixels, and comment the following lines, it does work and change the height to 100 pixels.Any ideas guys? How come setting an element's height to screen.height doesn't work?I tried this idea in a simple test page and it did work. Share this post Link to post Share on other sites More sharing options...
Burhan BVK Posted July 11, 2011 Posted July 11, 2011 Try screen.height+'px' . Share this post Link to post Share on other sites More sharing options...
Muller Posted July 11, 2011 Posted July 11, 2011 So simple, well done man Share this post Link to post Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now