Jump to content

[Solved] center_column is null when onload function is fired


Recommended Posts

Hey guys,

I've inserted the following code in header.tpl right below {$HOOK_HEADER} and above </head>:


   [removed] (javascript statement)

   window.onload = changeHeight();

   function changeHeight() {
       document.getElementById("center_column").style.height = "500px";

   [removed] (end of javascript script)


And I get a null error on the center_column element, like it doesn't exist.

Should I place this code somewhere else?

Share this post

Link to post
Share on other sites

Ok, I solved this by moving the code to the footer.tpl file. Also the 200px needs to be in quotation marks.

Now I have another problem, which is that screen.height doesn't seem to work. It works in a simple test page that I did, but doesn't seem to work in Prestashop. I'm making another thread.

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More