PDA

View Full Version : Really quick question



Irishjugg
07-22-2008, 08:18 PM
For the onLoad event.
If I do a script in the body onload to check the height of two css elements and decide which is larger, then set them both to the size of the larger element (column matching), will the actual page data (text and images) have been loaded yet, expanding the columns, or will the content not yet have loaded?

riptide
07-22-2008, 09:21 PM
I think it's suppose to; but I always have problems when using event handelers in the body tag.

Nile
07-22-2008, 09:24 PM
From what I know, if you've got the onLoad, it will execute before the content, images, or what ever you have in there is loaded. But if you got a javascript flashing text or something in there, that will load at the same time. So give it a try, if it doesn't work. Please post your code and a link to your page.

Irishjugg
07-22-2008, 09:53 PM
Is there by any chance an event handler for onFinishedload or anything.
Im just tring to resize two columns to the same size dynamically based on which is bigger, allowing for a clean stylesheet appearance and layout. I saw it suggested to use JS and wasnt sure what events I should attach to.

blm126
07-22-2008, 11:09 PM
onLoad will not execute until the entire page has been loaded. So, it can be used for what you want, although I would recommend against using JS to style the page like this. Your page will break if the user tries to adjust the window size or if the change the font size, etc. It is a much better practice to just use CSS for styling(same size column can be done in CSS)