[b]this is not completed, i'm posting it before i click wrong and it is lost
I am new to javascript, and i am making a webaplication in php. Some of the divisions have to be resized, and i use javascript to do this. It doesn't work, and I can't find my fault. Here is a piece of the code:
Code:
<script type=\"text/javascript\"><!--
function wreg()
{
var pageh = document.getElementById('page').Height;
var hsmlh = document.getElementById('hsml').Height;
var hlrgw = document.getElementById('hlrg').Width;
var wrknw = document.getElementById('wrkn').Width;
var hlrgh = var pageh - var hsmlh;
var tiliw = var hlrgw - var wrknw;
document.getElementById('hlrg').Height = var hlrgh;
document.getElementById('tili').Width = var tiliw;
}
function expand()
{
document.getElementsByName("cols").colSpan="9";
document.getElementsByName("expand").style.display=table-cell;
var expand=true;
}
function despand()
{
document.getElementsByName("cols").colSpan="5";
document.getElementsByName("expand").style.display=none;
var expand=false;
}
First off, you need to remove the 'var' for the pageh and hsmlh variables when you are setting the hlrgh variable. Thisin itself will create an error, so change all of those variable definitions, and next is the actual styling statements. You must set what's on the right of the equals sign in quotes, unlike in CSS where you don't need them. Try it out and see how it goes.
ZIP is not useful. You have there server-side variables we can not reproduce.
Or: try to isolate the problem. Remove everything is not related with the problem. Do create a small HTML/CSS/JS file which shows only that the error. Isolating the problem is, usually, a good method to find yourself the solution.
Bookmarks