Results 1 to 5 of 5

Thread: Really quick question

  1. #1
    Join Date
    Jun 2008
    Posts
    53
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default Really quick question

    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?

  2. #2
    Join Date
    Nov 2006
    Posts
    236
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    I think it's suppose to; but I always have problems when using event handelers in the body tag.

  3. #3
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    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.
    Jeremy | jfein.net

  4. #4
    Join Date
    Jun 2008
    Posts
    53
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default

    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.

  5. #5
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    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)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •