Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

How would you make the images load before the text on a webpage?

Like a have a background image called background.jpg, and I want that to load before I see any text. How would that be done?

3 Answers

Relevance
  • NervXT
    Lv 4
    1 decade ago
    Favorite Answer

    http://forums.asp.net/p/1579444/3975691.aspx

    This seems to be the trick, in part at least. Pages load all at once, well not technically all at once, but with fast connections it sure seems that way. A Javascript seems to be the best bet.

  • 1 decade ago

    Use javascript to load your site. Meaning, no static content. Everything is dynamic, like facebook. So, load the loader, then let it load the images, and once they're done, load the text.

    However, why are you trying to do this? Generally you want to hide everything until both images and text are loaded, and then display both at the same time. Is that what you wanted?

    In that case, just render everything in a hidden element, and onload, make it visible.

  • 1 decade ago

    This should be possible, but it might not be very easy. I'm thinking perhaps you could use Javascript to create an Image object with the same source as the background, and then set its onload to a function that then displays the text. I can't 100% guarantee that this will work, though.

Still have questions? Get your answers by asking now.