Jump to content

[Solved] center_column is null when onload function is fired


Muller

Recommended Posts

Hey guys,

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


{literal}

   [removed] (javascript statement)

   window.onload = changeHeight();

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

   [removed] (end of javascript script)

   {/literal}



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

Should I place this code somewhere else?

Link to comment
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.

Link to comment
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...