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.

Need to preload all images in folder on server.

Discussion in 'JavaScript' started by Sleeping Troll, Mar 13, 2009.

  1. #1
    This is the site,
    http://bragflags.bravehost.com
    The admin creates templates for the site, I need to preload all the images without regard to the name, just by thier presence in a folder on the server.

    Optimally I would do it via ajax, anyone know if this is possible without tying up good 'ole single threaded javascript?
    SEMrush
     
    Sleeping Troll, Mar 13, 2009 IP
    SEMrush
  2. dimitar christoff

    dimitar christoff Active Member

    Messages:
    882
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    90
    #2
    a while back a did something similar as i wanted a gallery that just took a folder of images and worked, no setup etc.

    i never did finish it but the preloading works fine, based on the mootools Asset.images(array) / Asset.image(singleimage);

    check it here - http://dci.uk.net/gallery/, the list is populated by a php script that produces a simple js array. once preloading has finished, ALL of the images being browsed are cached and shown instantly - some of them are 1-2mb in full screen...
     
    dimitar christoff, Mar 13, 2009 IP
  3. NoJster

    NoJster Guest

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    What I like to do is to just load all the pictures hidden ( CSS property "visibility: hidden" ) and then change their visibility based on onmouseover/onmouseout events.
     
    NoJster, Mar 16, 2009 IP
  4. kiwin

    kiwin Peon

    Messages:
    281
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    @ dimitar christoff nice script! really helpful. :)

    I never get the margin-left/right: -999999 or display:hidden to work I dont know why..
     
    kiwin, Mar 23, 2009 IP