1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Preload Scripts - any ideas?

Discussion in 'HTML & Website Design' started by misohoni, Jun 20, 2005.

  1. #1
    I have DW MX 2004 and there's a preload images script on there, but wondering if there is a better one out there?

    I want to preload all the images in the images/ directory before the page loads. I've made an attempt at the code below but not 100% sure if it works:


    function preloadImages() {
    if (document.images) {
    preloadFlag = true;
    }
    }
     
    misohoni, Jun 20, 2005 IP
  2. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #2
    So instead of showing your page drawing images, this will cause the page to seem to be waiting while all images load first to pop um all off at once instead of the user knowing they are at your site and watching it draw?

    I can't see a dial up user sticking around for that if that is the case in most instances.
     
    noppid, Jun 20, 2005 IP
  3. misohoni

    misohoni Notable Member

    Messages:
    1,717
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    200
    #3
    Yep that's a valid arguement however I've only a couple of images and they are only 1kb/2kb...
     
    misohoni, Jun 20, 2005 IP
  4. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #4
    Sounds like it'll be ok, but the overhead for the java and the result can not be faster then a straight render IMHO, it's more to download and then a client operation above what is normal. :)

    Gotta love those double edge swords.
     
    noppid, Jun 20, 2005 IP
  5. Juls

    Juls Well-Known Member

    Messages:
    1,867
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    170
    #5
    i agree with noppid, why not just load the images directly atleast your visitors will know the progress of the loading of the images.
     
    Juls, Jun 20, 2005 IP
  6. noppid

    noppid gunnin' for the quota

    Messages:
    4,246
    Likes Received:
    232
    Best Answers:
    0
    Trophy Points:
    135
    #6
    Oh yeah, and what if the client has javascript off?

    I'm just playing devils advocate to inspire ideas, I'm in no way mocking you. :)
     
    noppid, Jun 20, 2005 IP
  7. misohoni

    misohoni Notable Member

    Messages:
    1,717
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    200
    #7
    Thanks, I don't feel mocked? Alot of the top sites have preload, so I think you guys should consider it also...

    Think about CSS which refers to a background image, such as an outline border. If you don't preload it then it takes a few seconds to load and it doesn't look professional.

    BTW - my try at the script didn't work. I've come across some on the net but since most are dated circa. 2000 I wonder about their usefulness...
     
    misohoni, Jun 21, 2005 IP
  8. just-4-teens

    just-4-teens Peon

    Messages:
    3,967
    Likes Received:
    168
    Best Answers:
    0
    Trophy Points:
    0
    #8
    how about if you used javascript to pre-load them a page before?
     
    just-4-teens, Jun 21, 2005 IP
  9. misohoni

    misohoni Notable Member

    Messages:
    1,717
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    200
    #9
    I was think of the page-preload script, but I'm using the same graphics. It would be great to preload the graphics which are referred to in the CSS, then load the CSS after so it all fits in nicely...
     
    misohoni, Jun 22, 2005 IP