Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
-1
rated 0 times [  2] [ 3]  / answers: 1 / hits: 133421  / 14 Years ago, tue, may 11, 2010, 12:00:00

I've got the following code in a website:



 window.onload = resize;
window.onresize = resize;

function resize(){
heightWithoutHeader = (window.innerHeight - 85) + px;
document.getElementById(main-table).style.height = heightWithoutHeader;
document.getElementById(navigation).style.height = heightWithoutHeader;
}


The onresize works fine, but the onload event never fires. I've tried it in Firefox and Chrome and neither of them works.



Thank you for your help and go for the reputation! ;D


More From » onload

 Answers
68

I think what's probably happening here is that your window.onload is being overridden later, check to make sure that it's not via things like <body onload=>



You can check this by alert(window.onload) in your re-size function, to see what's actually attached there.


[#96813] Saturday, May 8, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
gideonb

Total Points: 187
Total Questions: 101
Total Answers: 86

Location: North Korea
Member since Mon, Feb 27, 2023
1 Year ago
;