I have this template/portfolio I'm working on, and using PHP to list the files (all images) in a directory to be a dynamic gallery. The only problem is that instead of using separate pages, everything is on one page. To accomplish this I'm using jQuery, but when I switch to the div with the gallery in it, it takes 10+ seconds to load. So, how would I go about preloading the images to be listed?
here's the working demo: http://unedible.com/alicewhite/something/
Can anyone help?
PHP list images in directory, but also preload them?
Moderator: General Moderators
Re: PHP list images in directory, but also preload them?
Oh my. I'm afraid 10+ seconds is rather generous. I also had to switch to Konqueror to view the page, as it was freezing firefox. It also responds slowly in Google Chrome.
Your images are gigantic! Do not use those images for the thumbnails! Generate small thumbnail images for the user to click on, then load each image on-demand. Also, resize even your large images to something reasonable; 960px along the longer dimension is more than large enough. Optimize your compression.
In GIMP, check the "Preview Image in Window" option of the JPEG save dialogue, and play with the settings until the image still looks good, and your file size is as low as you can get it. If you are using Photoshop, well, for the price, it should have something similar.
Also, be warned; the way your page is aligned it does not scroll correctly if the vertical size of the window is too small. It does fit in a maximized window on my MSI notebook computer, but it is very scrunched even in a full-screen browser on my HP Mini.
Good Luck!
Your images are gigantic! Do not use those images for the thumbnails! Generate small thumbnail images for the user to click on, then load each image on-demand. Also, resize even your large images to something reasonable; 960px along the longer dimension is more than large enough. Optimize your compression.
In GIMP, check the "Preview Image in Window" option of the JPEG save dialogue, and play with the settings until the image still looks good, and your file size is as low as you can get it. If you are using Photoshop, well, for the price, it should have something similar.
Also, be warned; the way your page is aligned it does not scroll correctly if the vertical size of the window is too small. It does fit in a maximized window on my MSI notebook computer, but it is very scrunched even in a full-screen browser on my HP Mini.
Good Luck!
Re: PHP list images in directory, but also preload them?
Thanks for the reply 
I was hoping I wouldn't have to resize them. But thanks for the info
I was hoping I wouldn't have to resize them. But thanks for the info