Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Feb 2004
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Setting load order for page items

    I have been told there is a way to make different page elements(e.g. <div> elements) load in a certain order, im asking because i have a website with 3 <div> elements and a .swf menu, but the menu always loads last, how would i stop everything else from loading until the menu is loaded?

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The "load order" is detemined by the order in which they are delcared on the page AND by the order in which the server provides them. Larger files will also obviously take longer to arrive at the client than smaller files.

    There's no surefire way to control this except to build all the contents into the original file.
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #3
    New Coder
    Join Date
    Feb 2004
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What do you mean by 'build all the contents into the original file.'??

    David, 14

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Have you ever noticed that some spam messages have images in them even though you may not have an active internet connection when you view the message?

    That's because the image data is part of the file that's sent to the user and not sent as a link to an external source. That same capability is available for ordinary html, it's not something special added just for the benefit of spammers. The key is that it isn't real simple to use so it's mostly spammers who are using it.

    From your description it appears to me that your problem though seems to be in getting a menu to be usable before the rest of the page loads. I'm going to assume that means you've got a javascript based menu and a number of images as well and your menu isn't available until the images have finished loading AND the images take long enough to load that you users get impatient for the page to come available. Please advise if my analysis of the problem in incorrect or incomplete.

    Probably the first thing you might want to look for may be in the menu code itself, many javascript menus use the "onload" clause to initialize themselves so they explicitly wait until everything else on the page has finished loading before they'll perform whatever magic they need to do in order to work. Sometimes you can simply bypass the onload and have the menu work earlier but there are many menus out there which definitely need to have the page loaded first. Menus which use images almost always fall into that category.

    Another thing you can check is to make sure your images are "optimized" for web viewing so they'll load as quick as possible. I can recall visiting a page which had a large number of thumbnail images on it but every single one of those thumbnail images was a fullsize image which took a very long time to load. Make sure your images are exactly the same height and width as specified in the image tag which calls them so they aren't oversized. If you need thumbnail size views, make sure you create separate thumbnail size images for those views.
    Check out the Forum Search. It's the short path to getting great results from this forum.


  •  

    Posting Permissions

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