Dynamic jQuery Image Gallery with Uploader
Development September 13, 2009 by chadking 18 Comments
Here’s a jQuery Image Gallery script with a multi file Uploader, that was implemented using three resources that I found on the web:
click on the image to see a demo
It’s easy to find a lot of good image galleries out there, a lot of upload scripts and thumbnail generators. But I found it hard to find one script that includes them all, so I decided to try to integrate them in one, which is actually what is interesting to have in a site. I basically put them together and added one or two functions to the whole thing, and added some Ajax script to load the pictures.
So now, besides being able to see the gallery, which is pretty cool by the way, you can upload multiple image files (for this demo just jpg and gif, although you can configure what you want) next to it and have them added to the gallery on the fly, after the upload is finished (you can click on “last uploads” in the demo to see the last images). If you don’t want that the images are loaded immediatly after you upload them, then just remove the onAllComplete option in the innitialization of the uploadify plugin, in index.html.
Because this is a demo I limited the pictures size that you can upload to 500kb, and you can just upload 5 at a time. Of course then you can configure this as you like.
For the thumbs and images generator, I use the class.upload.php script (very nice work), and I call it in the file uploadify.php. There you can configure the way you want your pictures to be generated, both original and thumbnail (for example the sizes, the filenames, the maximum size, if you want that pictures with the same name are replaced …). For this script I generate a hash for the name of the files, which will be always different. You can change that if you want… Remember that the folder where the pictures are stored (images and images/thumbs) should have the right permissions in order for you to upload your files.
I would suggest that you take a look at the possible configurations for each one of the scripts that I used:
see the DEMO
download source code here
You can find more jQuery Image Galleries here
If you have any suggestions for this script, or if you find some bugs please let me know.
Discussion18 Join the discussion
Trackbacks
- jQuery Image Cropper with Uploader | Codrops
- uberVU - social comments
- URL Image Getter/Uploader/Resizer | Codrops











Would it be possible to configure this so that the image uploader is on a different page than the actual gallery so that it could be used as an admin feature? This way the admin could easily upload images that are then passed to the main gallery on the website.
Hi Lindsey,
Yes, that’s possible. Take a look here:
http://tympanus.net/gallery2/index.html
you can download it here:
http://tympanus.net/codrops/wp-content/uploads/2009/09/gallery2.zip
Greetings
perfect! Thanks so much!
Hi there, this is ace, but how do you make the newly uploaded image display at the start? Thanks
Hi,
You need to revert the file array. I updated the file:
http://tympanus.net/codrops/wp-content/uploads/2009/09/gallery2.zip
Inside theres a ajax.php and ajax2.php. Right now the first one is being used. If you want to show the images in that order use ajax2.php!
greetings
it is very usefull solution for me , I added delete function on thumbnails, trying to integrate in drupal, its works – displays all images but upload didn’t works , (i think it path problem in ajax.php) any suggestions?
Hi,
Its a great script you have here, works very nicely. I am trying to implement a way of deleting images that have been uploaded. How would you go about this?
Jim.
Hey,
I really like this great script!!! :)
I have a question about modifying the image description: is it possible to change it to something else?
Thanks,
Jude
Hi,
Thanks!
I didn’t consider that in this version. The aim was just to merge the 3 scripts mentioned in the post. I will consider that for the next version though!
Hi,
Thanks for the fast answer:)
I see your point, this is cool merging indeed:)
I’ll try to think of it..
Take care!
Jude
Hey guys, is there any way to have categories for the galleries? Maybe if I upload a batch of images to an “x” folder, that’d be a category, how can I make that to be selectable?
Thanks!
3 Things that would make this gallery the perfect gallery solution:
1. Adding a page after uploading images that displays the image with a field to enter and save a caption.
2. Adding an function that allows you to create/choose and album for your images to be uploaded to. Adding an album page that displays a thumbnail from each album and opens the corresponding gallery.
3. Adding a function to delete or hide images and albums.
If I knew how to do any of this I would definitely contribute…
Perfect! Thx a lot. :)
Could you write the delete function please .
fantastic, useful work.