I am trying to write a function that will centre a DIV-layer into the middle of the web browser screen. This is only for Internet Explorer. I keep getting and Invalid Argument error whenever I call the function (in the line oRef.style.left = ...).
I am brain dead! What's wrong with my code?
TIA..
function CentreOnScreen( LayerID)
{
var oRef = eval('document. all.'+ LayerID);
//alert(oRef +', '+ LayerID);
oRef.style.left = (screen.availWi dth - oRef.style.widt h)/2;
oRef.style.righ t = (screen.availHe ight - oRef.style.heig ht)/2;
oRef.style.zInd ex = 1;
}
I am brain dead! What's wrong with my code?
TIA..
function CentreOnScreen( LayerID)
{
var oRef = eval('document. all.'+ LayerID);
//alert(oRef +', '+ LayerID);
oRef.style.left = (screen.availWi dth - oRef.style.widt h)/2;
oRef.style.righ t = (screen.availHe ight - oRef.style.heig ht)/2;
oRef.style.zInd ex = 1;
}
Comment