15
May

Ajax Image Gallery

This extremely lightweight JavaScript image gallery and slideshow script clocks in under 3kb packed and includes a number of cool features. Recently I was looking for a nice existing script for a client project. I wanted something elegant, simple and lightweight. What I found were a number of scripts built on JavaScript frameworks and a few others that really lacked any appealing interface or were over 30kb. I challenged myself to build a full-featured slideshow gallery under 4kb. Hopefully I will be add a few more features to the script soon and make it a little mode user-friendly.

Here is an example of the markup…

<div id="gallery">
<div id="imagearea">
<div id="image">
<a href="javascript:slideShow.nav(-1)" id="previmg"></a>
<a href="javascript:slideShow.nav(1)" id="nextimg"></a>
</div>
</div>
<div id="thumbwrapper">
<div id="thumbarea">
<ul id="thumbs">
<li value="1"><img src="thumbs/1.jpg" alt="" /></li>
<li value="2"><img src="thumbs/2.jpg" alt="" /></li>
<li value="3"><img src="thumbs/3.jpg" alt="" /></li>
<li value="4"><img src="thumbs/4.jpg" alt="" /></li>
<li value="5"><img src="thumbs/5.jpg" alt="" /></li>
</ul>
</div>
</div>
</div>

The list section is the important element to the gallery. Each li has a value property that is set to the name of the full-size image. The interface is very flexible and can easily be altered in the HTML and CSS.

You will also need to setup the variables below and include the slideshow JavaScript…

<script type="text/javascript">
var imgid = 'image'; // id of image div //
var imgdir = 'fullsize'; // full-size image directory //
var imgext = '.jpg'; // full-size image extension //
var thumbid = 'thumbs'; // id of the thumbnail container //
var auto = true; // automatic rotation toggle //
var autodelay = 5; // seconds before the image rotates //
</script>
<script type="text/javascript" src="packed.js"></script>

This script isn’t completely polished yet but I wanted to go ahead and get it out there for anyone that can put it to use. It is tested working in IE6/IE7, FF, Opera and Safari. Feel free to use it in any personal or commercial projects. Please send any bug reports to michael@leigeber.com with the title “BUG REPORT”.

Click here for the demo.

Click here to download the source.

Update 5/16/2008 - Updated CSS and added outline:none for the next and previous links.
Update 5/26/2008 - Updated the CSS to resolve an issue with resizing the window in IE6. Thanks to Jon Stoski for reporting.
Update 5/28/2008 - Pushed script inside global namespace. Fixed a couple IE related bugs.



3 Diggs Spread This

310 Responses


personally i think you are selling a load of crap, the download file is not even close to 3kb, you are not talking about the include files you only talk about the html.
nice try but real webdevvers do it official style

G on 15 May 2008 at 12:28 pm

@G - The zip file includes all the images included in the demo. I put these scripts out because I want to help other people. I am not selling anything here, sorry I don’t fit your bill of a “real webdevver”.

Michael on 15 May 2008 at 12:37 pm

@G - Two clues that you don’t know what you’re talking about: you used the words “real webdevvers” and you left an anonymous comment.

Thanks for sharing the code Michael!

Bryan Peters on 15 May 2008 at 1:21 pm

And where’s the Ajax in all of this? Ah yes, the title says so … it MUST be Ajax then!

(yes, that’s between < sarc > tags!)

Bramus! on 15 May 2008 at 3:02 pm

@Bramus - Perhaps not Ajax in the truest sense of the word, no. The images are loaded as they are called and not all at once as they are in many similar scripts. There is no question the term “Ajax” has gained a broader meaning than its true definition, like it or not. In my opinion “Ajax” pretty accurately identifies the gallery as dynamic in nature, I meant no harm by it. The post title has been changed.

Michael on 15 May 2008 at 3:14 pm

I like the fact that the JS is very small — reminds me of moo.fx and the good old days.

Though, I think it’s a little misguiding that the “next photo arrow” still appears when you are looking at the last photo of an album.

Thank you for sharing this little script anyway :)

Louis on 15 May 2008 at 3:54 pm

@Louis - Thanks for the feedback, I thought it would be easier than clicking back through the previous images to get to the beginning. If anyone wants to second that the arrow should not be present on the last image I will take it out.

Michael on 15 May 2008 at 4:10 pm

Michael, this is really impressive. Thank you very much for sharing it. Really appreciated.

Neil on 15 May 2008 at 4:18 pm

Thanks very much for this. Great work. I don’t understand why anyone gets critical about this as it is done free of charge. I agree with Neil, much appreciated.

Ian on 15 May 2008 at 7:19 pm

Michael, this is a great piece of work.

It’s light, looks good, and seems to be solidly coded.

Thanks for releasing it.

I personally like the arrow to go back to the start, so I vote to keep it.

If people as thick as G, and don’t know how to look inside a zip file before deciding how big something is, are the “real webdevvers” I hope I never become one. :)

Daniel on 15 May 2008 at 10:05 pm

You might want to add outline: none; to the links to prevent Firefox from outlining the right and left links with a dotted outline.

Andrew Mason on 16 May 2008 at 3:03 am

Thanks for sharing.
One minor note: in your style.css you should add the rule “outline: none;” to your #previmg and #nextimg so they won’t show the focus rectangle when they are clicked in Firefox.

Loris on 16 May 2008 at 3:05 am

I didn’t peak into the code, but assuming it is that small, nice job! I was getting hung up when using the navigation arrows though.

Oh, nice house too!

BillyG on 16 May 2008 at 3:51 am

[...] web: http://www.leigeber.com/2008/05/ajax-image-gallery-slideshow/ Share and Enjoy: These icons link to social bookmarking sites where readers can share and [...]

Dynamic Image Gallery e Slideshow di immagini : sastgroup.com on 16 May 2008 at 3:53 am

Very nice. I think I’ll be using this one. Thank you!

Ezuk on 16 May 2008 at 4:16 am

Nice slideshow! Thanks for sharing it with everyone! I’m amazed at how negative people can be!

Sean

Sean on 16 May 2008 at 5:16 am

Thanks for this. Very nice and simple. Well done.

captain on 16 May 2008 at 6:45 am

Thanks for all the positive feedback. I have updated the script with the outline:none, thanks for the suggestion. @BillyG - I will try to replicate the error and resolve, thanks for reporting.

Michael on 16 May 2008 at 8:13 am

hi nice ajax script.
would you merging your script into JQuery? i think your script will be more simple & flexible with JQuery. thanks for sharing it.

wisnoe on 16 May 2008 at 8:44 am

[...] Скрипт действительно не плохой. Автор обещает его доработать и сделать более удобным. Демо можно просмотреть здесь. Непосредственно код можно скачать здесь. Первоисточник здесь. [...]

Блокнот » Blog Archive » AJAX: Галерея и слайд шоу on 16 May 2008 at 9:11 am

Very Nice! Thanks for sharing

zaha on 16 May 2008 at 9:11 am

@wisnoe - I definately plan to incorporate this into jQuery along with most, if not all, of the other scripts I have written. I am a big jQuery fan and jQuery scripts have been requested many times already. Definitely on the to-do list, thanks for the suggestion.

Michael on 16 May 2008 at 9:19 am

Great wee script….& for the record I see the packed version at 2,914Bytes! ;)
But rather than just showing thumbnails to users without CSS/Javascript why not link the thumbnails to the large images, then you could use the href of that link to determine the large image location.

That way your large images would be viewable by everyone and you wouldn’t be shoe-horned into keeping all large images in the same folder or naming them the same as the small image & finally they could all have different extensions :)

Aaron Bassett on 16 May 2008 at 9:35 am

@Aaron - Thanks for the feedback. Want to make sure I am following you correctly… are you suggesting that I remove the dynamic loading and just hyperlink to the image location?

Michael on 16 May 2008 at 9:42 am

This is pretty sweet. Now, I’m one of those people that knows enough to be dangerous but not enough to really cause any serious damage.
I noticed you changed the title from AJAX to Dynamic. Does that mean that it still pulls the images without ever needing to reload the page? I really like your demo and for myself I would think a couple things.
I was thinking that it would be awesome if when you selected a picture or gave a picture focus by using the arrows that it would give the thumbnail focus too. Maybe the slide transition could move to a certain spot and have a particular outline/border given via CSS. Also, it would be nice to be able to use any size image (roughly). Allow for resizing the image viewing area depending on the image size.
I think your script is awesome so I’m not trying to bag on it. Those things just sounded like good options for myself.
Keep up the good work man :D

The Real Trevor on 16 May 2008 at 7:07 pm

@The Real Trevor - I changed the title due to the Bramus’ objection to my use of the term. The images are still pulled in dynamically. I had thought of your first suggestion and will definitely include it in version 2. I had not thought of the second but will definitely consider it as well. My goal with the first version was to make something simple and lightweight. The next version will have many more features and be more user-friendly. Check back over the next week or two for the update. Thanks for the feedback.

Michael on 16 May 2008 at 7:17 pm

Terrific work. Simple and appealing. Thanks for releasing this to the public

Rob

Rob on 17 May 2008 at 9:45 am

[...] Dynamic Image Gallery and Slideshow - Web Development Blog lightweight slideshow script (tags: webdesign html css javascript) [...]

links for 2008-05-17 | JeremiahTolbert.com on 17 May 2008 at 10:37 am

[...] Dynamic Image Gallery and Slideshow - Web Development Blog (tags: gallery slideshow lightbox) [...]

links for 2008-05-17 « toonz on 17 May 2008 at 5:31 pm

Great work, Michael!
2 suggestions:

1) Can you make the Left/Right ARROWS
only appear when User hovers over the BIG photo?
In fact, the User could go:
- Forward, to next photo by simply clicking on the Right border
OR
- Back, to prev. photo by simply clicking on the Left border

2) Allow optional short CAPTIONS @bottom of BIG pic.
(text over a semi-transparent gray band, would look very nice…).

Thanks!!

Ray SF on 17 May 2008 at 11:16 pm

@Ray - Thanks for the feedback. I have the arrows visible so a user quickly knows that they have that navigation option. You can easily alter that by removing the background images through the CSS. Your second suggestion is planned for the next version which I will have up soon.

Michael on 17 May 2008 at 11:43 pm

Wow , great :) ….
Just want to ask. Is it possible mouse hover (not click) as action trigger to display the large image ?

achmadbiz on 18 May 2008 at 3:53 am

[...] Dynamic Image Gallery and Slideshow por Leigeber [...]

Freak-Log™ #12 — Freak Group on 18 May 2008 at 8:30 am

@achmadbiz - Absolutely, all you need to do is t[i].onclick on line 27 of slide.js to t[i].onmouseover. Shoot me an email if you have any problems.

Michael on 18 May 2008 at 9:58 am

Good Job!!!
Thanks a lot!!!

Denis on 18 May 2008 at 4:34 pm

Yup, i’ve tested :) and it works, many thanks to you… God bless you … :)

achmadbiz on 18 May 2008 at 6:39 pm

<strong>Dynamic Image Slideshow…</strong>

A lightweight JavaScript image gallery and slideshow script. Free to use in any personal or commercial projects.
……

Visual-Blast Media on 20 May 2008 at 2:42 pm

I don´t use sequencial numeric image names, but dinamic filenames.
is possible?

thanks!
alexandre (brazil)

Alex on 20 May 2008 at 6:14 pm

@Alex - You can use any filename you want, I just happened to use sequential names in my demo. Enjoy.

Michael on 20 May 2008 at 6:26 pm

[...] Dynamic Image Gallery and Slideshow - Web Development Blog [...]

Daily Blog Post 05/20/2008 « Murratore’s Weblog on 20 May 2008 at 7:04 pm

Nice Michael, thank you!

Alejandro on 21 May 2008 at 4:45 am

[...] Leigeber publican liberan una galería de imágenes en JS que sólo ocupa 3kb. 0 [...]

Galería de imágenes ultraliviana — Tablosign on 21 May 2008 at 7:02 am

I’m going to post this on my blog…very Nice! Thanks for sharing

Just Listed Postcards Guy on 21 May 2008 at 11:33 am

Michael

Your slideshow looks great. I have a questions/suggestion. Is it possible to have each of the big picture hyperlink to a specific page when click on?

Thanks,
John

John on 21 May 2008 at 1:49 pm

@John - Absolutely, anything is possible :-) You would need to pass in an additional parameter to the getImg function for the url and then either dynamically add an a element to the DOM or just modify the href on a pre-existing a element. You could also do the window.location method directly on the image’s onclick event. Shoot me an email at michael@leigeber.com if you have any questions.

Michael on 21 May 2008 at 1:54 pm

Looks quite nice. Good work!

mark on 21 May 2008 at 3:27 pm

One word only: FABULOUS! Keep up the good work, Michael!

lancey on 21 May 2008 at 5:51 pm

[...] Galería de imágenes Descarga: Slideshow.zip Demo: Galería de imágenes Vía: [...]

Una completa galería de imágenes javascript en tan solo 8KB | Adictos a la red on 22 May 2008 at 6:59 am

simple an dcool :) thanks

Webdesigner on 22 May 2008 at 7:27 am

when hovering over the thumbs, is it possible to increase the speed? where in the script, can I find it?

Matt on 22 May 2008 at 12:29 pm

@Matt- Sure, sorry it is not so clearly identifiable since I was going for ultra-compact on this script. The st and ss variables at the top of the script define the slider timer and the slider speed, the ss being how quickly the function is called in succession and the ss is how many pixels the div moves on each function call. The combination of both of these determines the speed and fluidity.

Michael on 22 May 2008 at 1:06 pm

awesome, thanks for your help - great script by the way!!

Matt on 22 May 2008 at 1:56 pm

This is wonderful! I was planning on building my own gallery as well, since I ran into the same problems as you (bloated, ugly code). You’ve done a great job. Keep up the good work.

Josh Ellington on 22 May 2008 at 3:29 pm

Great stuff! Thanks!

Braintrove.com on 22 May 2008 at 5:29 pm

[...] and includes a number of cool features.” You can view a demo here and find more details here. This entry was written by admin and posted on May 23, 2008 at 9:24 am and filed under Free [...]

Dynamic image gallery and slideshow | Fluid Web - webdesign blog on 23 May 2008 at 12:25 am

I have selected ajax enabled website & add code along with javascript files.
But li tag cannot access value property, so i have seen only images. Slideshow
doesn’t work at all. can u tell ,e where is the problem?

Abhijeet Musale on 23 May 2008 at 4:48 am

[...] Dynamic Image Gallery este o galerie de imagini bazata pe JavaScript si testata pe IE6/IE7, FF, Opera si Safari. [...]

OneDesign| Dynamic Image Slideshow on 23 May 2008 at 5:29 am

great script - we like these little guys!

3 small comments:
1) i agree about the direct link to the larger images from the thumbnail lists, makes for better scalability. hopefully yu would still be able to load it dynamically (much like lightbox and co)

2) between loading the large photos - there is that annoying white screen with the loading icon. any way to not have to see the white screen would be good (maybe show the loding icon, but not make the previous photo leave till the new one is ready)

3) make some kid of an arrow for the thumbnail scroller, so that folks no there are more options, hidden.

cheers!!

snoop on 23 May 2008 at 8:25 am

@Abhijeet Musale - Shoot me the link to your project via email michael@leigeber.com and I will take a look.

@snoop - I helped a couple others incorporate linking the other day, you can view the demo at http://sandbox.leigeber.com/slideshow2/ You can definately alter the behavior of the transition, it would not be very difficult. Shoot me an email if you need help. I definately plan on adding your number 3 to the next version which I have already started coding. It will be a large improvement. Thanks for all your suggestions.

Michael on 23 May 2008 at 8:32 am

@ Michael - thanks for your help with the hyperlink, it works great!

John on 23 May 2008 at 9:43 am

[...] Der Autor wird noch viel arbeit damit haben, bei der Liste immer auf dem neuesten Stand zu bleiben. Das Skript von Michael Leigeber fehlt in der Liste. Diese Matrix ist jedenfalls als Ausgangspunkt für die eigene Recherche sehr [...]

F-LOG-GE » Blog Archive » Lightbox-Matrix on 24 May 2008 at 10:00 am

This is simple and very elegant. Thank-you!

I don’t know what I’m doing wrong but the slider doesn’t go beyond the eighth image for me. It just goes to number 8 and stops… I’ll send an email with a link to my project. along with the code I’m using.

coleen on 24 May 2008 at 10:36 am

it’s good design, thanks.

Fatihto on 24 May 2008 at 2:00 pm

This is simplitastic !!!

I have a request for one minor tweak :) When I navigate from one image to another using the right and the left arrow, the images in the slider pane does not change i.e. they are not in sync. If the images in the slider pane will keep in sync with the images being showcased, it will be a great improvement from a usability standpoint.

Keep up your good work.

TRIO IT Support on 26 May 2008 at 10:53 am

@Trio - Thanks for the suggestion, it is on the list for v2 which I hope to release in the next week or two.

Michael on 26 May 2008 at 10:57 am

good work, greetings from Kenya

Raymond Sefu on 26 May 2008 at 1:09 pm

Hey there,

I like your little javascript viewer, its nicely done. KUDOS!
I noticed a problem while trying it out: when resizing my window (IE6) the main display area stays stationary while the rest of the control area shifts with the changing window size. FYI
Also a personal opinion about focus and the image slideshow: I don’t mind the slideshow effect before I use the arrows to control the picture, however once I use the image controls the slideshow rotation should stop. It feels like the computer is taking control back, IMO

Jon Stoski on 26 May 2008 at 4:02 pm

@Jon - Thanks for reporting the IE6 issue. I recreated the issue, corrected it and have updated the post. As for the second suggestion, I did consider that. I decided to let it continue but that could easily be altered and I will weigh the issue out a bit more for V2.

Michael on 26 May 2008 at 4:31 pm

Thanks for this Michael, It really is a shmick little bunch of code, and also very flexible. Much smaller and neater than a flash or silverlight solution and best of all, easy to update for all of our little n00b clients!
Thanks again!

Adrian on 26 May 2008 at 8:26 pm

I’m truely saddened by the first few comments and overjoyed to see that the majority can appreciate the work you have put in here and then given freely to the community.

It’s quality contributions like yours that continue to raise the bar for developers like myself.

Thank you.

Damien on 27 May 2008 at 6:22 am

Nice man.

Haven’t tried, but would this work with a .mov or something - guess you’d need to include the embed script inside the <li> tag.??

And, how would I stop the slideshow altogether? So it’s just a click to view type scenario.?

thanks, good work.
T…

tim... on 29 May 2008 at 12:59 am

Actually, all I want is the scrolling images which I’d attach a URL to. Anyone got a clue where I could get a script like that?

Sorry, I’m just a dumb designer.

T…

tim... on 29 May 2008 at 2:43 am

[...] kleines aber feines script hat uns michael leigeber beschehrt. Damit kann man bequem eine Bildergallerie anlegen und Slideshows bauen. Es ist völlig [...]

Bildergallerie Slideshow mit Ajax und Javascript for free » » pixey.de on 29 May 2008 at 7:35 am

@tim - The script could no doubt be modified to work with mov files. You can stop the slideshow once it has started by calling the slideShow.cncl function. As for your second question… I don’t know of anything pre-packaged like that. Your best bet is to modify my script. Shoot me an email if you run into any problems.

Michael on 29 May 2008 at 8:05 am

Is there a way to configure this to grab a set of images from a directory? Even for the thumbnails? That would be amazing if it were possible. Let me know, I really want to set that up :)

Axertion on 29 May 2008 at 12:05 pm

@Axertion - JavaScript does not have the ability directly to accomplish what you are asking. You could however use PHP and return JSON to the JavaScript to build out the list. I will put it on the list of addons for v2. Thanks for the suggestion.

Michael on 29 May 2008 at 12:34 pm

If you double click on a thumbnail that’s not currently displayed as the large image, it sort of freaks out and stops. Probably not a major issue, and I’m not even sure why I thought to try it, but I figured it was worth noting.

Otherwise, I like what I see. Contrary to some other people’s comments, I like that the slideshow doesn’t stop at the last picture and loops back to the first, and I also like that it keeps rotating even after you use the arrows. There’s already too many slideshows out there with a bunch of complex options, I like the simplicity of this one.

Jillian on 29 May 2008 at 1:20 pm

@Jillian - Thanks for the comments. I will take a look into the issue you described and keep your thoughts regarding the functionality in mind for v2.

Michael on 29 May 2008 at 1:22 pm

muy bonitooo, pero pienso que estaría mejor si las flechas serían de otra forma, otro estilo… buen trabajo!

leugim on 30 May 2008 at 7:00 am

@leugim - Gracias. Le invitamos a cambiar el interfaz.

Michael on 30 May 2008 at 8:09 am

Yea man, I know JS couldn’t do this :/, I’m trying to create a PHP method but I can’t seem to get it to work. If its not to difficult is there anyway I can get this soon? Thanks :)

Axertion on 31 May 2008 at 11:03 am

@Axertion - I have an overloaded plate for this weekend but next week I will be hitting v2 hard and will include this PHP option. Sorry for the long wait.

Michael on 31 May 2008 at 11:41 am

@Micheal. This version is great for me so far, but the li value doesn’t work as expected in my case. I have it named right. Name your price to have this PHP directory feature setup ASAP. Thanks ;)

Axertion on 31 May 2008 at 11:45 am

nice! I wish more people would create lightweight apps with code versus images and plugins more often!

jeremy on 31 May 2008 at 12:02 pm

@Axertion - Shoot me an email with what you have so far and I will take a look when I get a chance.

Michael on 31 May 2008 at 2:10 pm

[...] Galería dinámica AJAX con efectos visuales. [...]

JavaScript sin frameworks / acualicio.us on 01 Jun 2008 at 1:39 am

Michael, you are da BOMB!!! For anyone else who’s wondering about how his script and code works, it’s AWESOME!!! Plus, if you have any questions, he’s totally willing and fast about getting help to you. Some might think this a fluff piece, but I honestly have nothing but praise for this guy.
THANKS MICHAEL!! YOU ROCK!!!!!
A suggestion for your next Mod to this?? Maybe put the scrolling thumbs on the left and make them scroll up and down? just a thought, I know I could use it on a few of my other sites. Thanks!

Jeremy F. on 01 Jun 2008 at 9:25 pm

[...] Dynamic Image Gallery and Slideshow [...]

Best Design Articles from May 2008 on 02 Jun 2008 at 4:22 am

Hey man, I figured out how to list the thumbnails based on a directory using PHP. But since I started using this I’ve been having trouble with the fullsize images showing. I dunno if the directory looking isn’t working. So I made the directory the exact same as the thumbnails and it still isn’t working. It should because:

A) <li value=”imagename”><img src=”imagename.jpg”></li>

B) the defined directory is the exact same as the thumbnails meaning the image names are 100% exact. Any ideas?

I’ll email you the pages I’m working on, thanks…

Axertion on 02 Jun 2008 at 9:02 am

thnx a lot man.. i’ve been looking for a lightweight version for a project i’m about to undertake.. its people like you who have made me what i am today.. like the others we still waiting to see your implementation of php.. i’d try it out
l8r man..

styxGH on 03 Jun 2008 at 7:29 pm

Hi Michael,
this is very nice and simple to understand. but javascript in this gallery may be support in all browsers?

sagar on 04 Jun 2008 at 12:42 am

@sagar - The JavaScript is tested working in IE6+, Firefox, Opera and Safari. Of course whether the user has JS enabled will also play a part.

Michael on 04 Jun 2008 at 8:19 am

I too would be interested in seeing v2 with descriptive text overlays and separate links for each picture. Looks great though.

smith on 04 Jun 2008 at 10:12 am

Hi ML. I have downloaded source. My website have folder imagenews/thumbnail for upload pictueres when i show pictures on website is not run. it only run under’s images. I don’t know ‘”thumbs” what do it do?
Please help me.

cong on 04 Jun 2008 at 11:16 pm

@cong- It sounds like you need to change the imgdir parameter to match with your folder structure. if you can’t get it worked out shoot me an email.

Michael on 04 Jun 2008 at 11:21 pm

Hi–will likely use this to showcase some projects, I’ll let you know how it works out. Cheers!

Andrew on 05 Jun 2008 at 1:46 am

This is really nice ..can you use it in wordpress?? Ill try anyway..
Thanks this is really nice.

Danny on 05 Jun 2008 at 9:25 am

@Danny - Absolutely you can use it within Wordpress.

Michael on 05 Jun 2008 at 9:26 am

really frickin nice but could you add something or enhance it to work better on an iphone would be perfect for a webapp im thinkin of making

Jaswinder Virdee on 05 Jun 2008 at 4:28 pm

[...] Baixe Aqui, e sinta-se livre pra utilizar este script em projetos pessoais ou comerciais [...]

Galeria de Imagens SuperLeve em Javascript | RuanWeb on 07 Jun 2008 at 8:52 am

How would you go about adding more pictures to the slideshow?

Skribz on 08 Jun 2008 at 10:28 pm

@Skribz - Just add more thumbnails in the unordered list.

Michael on 09 Jun 2008 at 8:57 am

Is is possible use images that are saved in mysql db + and using php to display it?

Help on 09 Jun 2008 at 9:30 am

@Help - Sure, I know at least one other has done this and it will be native functionality in v2 which hopefully I will have time to release in the next week or two. Basically you would set up a loop and build out the markup for the unordered list, real easy stuff.

Michael on 09 Jun 2008 at 9:40 am

Michael it would be fantastic if you could post something up. i like your current viewer, however all my images are saved in mysql, i know how to access them, but not sure how to incorporate to your app.

Help on 09 Jun 2008 at 9:52 am

Michael, excellent reusable script. Good job. But one suggestion as well as need solution as quickly as possible. when left and right arrows are moved then the thumbnails should be in sync with the large image. Is it possible? If so, then how? Thanks in advance

Deepika on 10 Jun 2008 at 4:16 am

@Deepika - It can definitely be done and will be part of the upcoming version 2 but as of today that code is not complete.

Michael on 10 Jun 2008 at 7:57 am

hey I think that was some helpful info in general to maybe someone just getting started out. But overall a little outdated. I think you could really pump this up if you explained how to utilize this technique to interact with a database, or an automated PHP scripted XML file of some sort. That’s the whole point in structuring things like this is to develop something a client can add content to. It’s in a good format for further development. :-)

b-rad on 12 Jun 2008 at 4:48 am

Thx this great !

I think i found a little bug though: If there is a “underscore” ( _ ) in the name of the fullsize image, it wont display.

Ludo on 12 Jun 2008 at 5:28 am

Ignore my last comment, my problem had nothing to do with the underscore. In fact i have to use 1.jpg, 2.jpg and so on for it to work. If i rename the image and modify the html with another name for the fullsize image it wont work. ( ex: <li value=”tutu”><img src=”thumbs/1.jpg” width=”179″ height=”100″ alt=”" /></li> wont display tutu.jpg )

Anyway still a very nice script.

Ludo on 12 Jun 2008 at 5:44 am

@b-rad - This will be in version 2, definitely on its way.

@Ludo - The value parameter can easily be changed to the id parameter to allow greater flexability. This is also in version 2 that will be released soon. Shoot me an email if you need help getting it working sooner.

Michael on 12 Jun 2008 at 8:20 am

Thx for this slideshow it looks very good, keep the good work and don’t bother the criticism from some users.

Martin on 13 Jun 2008 at 1:30 am

[...] Описание Скачать Похожие записи: -  AJAX скрипт галереи с [...]

Ещё один скрипт галереи на AJAX » Скрипты » AllAJAX.ru on 13 Jun 2008 at 5:15 am

How can I use this to fetch image from a php mysql database.

Tosin on 13 Jun 2008 at 11:53 am

@Tosin - That functionality will be native to v2. It is very simple actually, you would need to create a loop for your results from the database and build out the list elements. Very basic stuff.

Michael on 13 Jun 2008 at 12:53 pm

Michael - Awesome script. Thanks for making this available to the public!

I do have one question: when you click either arrow, you eventually get to the end and have to click the opposite arrow. Is there any way to make the images loop infinitely?

Kevin on 13 Jun 2008 at 1:52 pm

@Kevin - Thanks. Not sure how you are seeing that. The script should function as you describe… maybe I am not understanding the question.

Michael on 13 Jun 2008 at 1:55 pm

Oops, you’re right it does loop. I clicked the arrow twice in a row and it froze the sideshow. It’s pretty easy to freeze (the double click issue)

Kevin on 13 Jun 2008 at 2:00 pm

@Kevin - Yes, I have run into that. I believe I have solved it in v2 so hopefully it will be gone soon.

Michael on 13 Jun 2008 at 2:03 pm

I think this website is great. I found a lot of treasures.

The thumbs needs arrows on the right and left. I did not know it moves until I hover.

Thanks and keep up the good work.

elvis on 15 Jun 2008 at 12:26 am

Hi there, Great script! I’m having issues adding more than 64 images. When I add the 65th image (of 68) the scroller stops working. Any tips?

Thanks, Michael

Further to that, do you have any tips for vertical images?

Agentwigs on 16 Jun 2008 at 3:57 am

@Agentwigs - You probably need to update the width of the #thumbs id in the CSS to a value greater than 10000px. Shoot me an email if that doesn’t work.

Michael on 16 Jun 2008 at 10:32 am

[...] das für die reine Präsentation von Bildern prädestiniert ist. Das winzige JavaScript (3KB) ist die ideale Möglichkeit schnell und schlank eine Galerie/Slideshow [...]

Kleine JavaScript Bildergalerie - Gery’s Blog on 18 Jun 2008 at 9:23 am

how to add caption in somewhere?

hd on 18 Jun 2008 at 11:46 pm

Hey, when is the new version comming - im dying to test it. Please let me know when to expect it.. thx for amazing work!!

marca on 19 Jun 2008 at 7:59 am

@marca - Been very busy as I am moving in a week and taking a new job. Will definitely spend a little time on it next week. It is pretty high up on the list.

Michael on 19 Jun 2008 at 8:10 am

@hd - This will be part of version 2, in the meantime you could definitely customize the script to add the functionality.

Michael on 19 Jun 2008 at 8:10 am

I haven’t tested this out yet, but it certainly seems to work very nicely on my Firefox 3.

Jim on 20 Jun 2008 at 6:08 am

First, I want to say Congratulations on a awesome script. Thanks! for sharing. I am having a problem though, I resized the image gallery and everything works in firefox but in IE 7 for some reason the hover area where you scroll the thumbnail images seem to be off. It seems that the hover areas to scroll the thumbnail are to the right of where it should be. Am I doing something wrong? In firefox it works fine but in IE7 it is off. Thanks in advance.

Yo on 22 Jun 2008 at 5:16 pm

Thanks for sharing the code and it is pretty simple to modify. I would like to add the url to the images, so when they click on the image it goes to a particular page. Is there a easy way to do this.

nita on 23 Jun 2008 at 11:51 am

@nita - Take a look at http://sandbox.leigeber.com/slideshow2/ where I helped someone else do the same thing. Shoot me an email if you can’t get it figured out or need help.

Michael on 23 Jun 2008 at 1:50 pm

Mike, in this slideshow2 it looks like no matter whichever image you click on it goes to the same page? Am I understanding it wrong? I want each image to go to different urls. Also where can I find the java script for this above mentioned page(slideshow2).

Thanks Mike.

Nita on 23 Jun 2008 at 10:49 pm

[...] Dynamic Image gallery and Slide show : E2 photo gallery alternatifi, tek eksiği php ile image upload olmaması. [...]

Ajax ile resim galerileri ve slide show oluşturun : Sinan Elver | Blog on 24 Jun 2008 at 3:07 am

Hi,

Interesting script - but I’m unable to use it with alphabetic filenames - it only works with files with numbers… Did you plan to make some changes to allow filenames with letters ?
A+

Didier on 24 Jun 2008 at 5:34 am

@nita - You can define the link, they just all share the same test link for the demo. You can check out the JavaScript at http://sandbox.leigeber.com/slideshow2/slide.js.

@Didier - Check out the link I gave to nita http://sandbox.leigeber.com/slideshow2/. You can define images with any names. The next version of this script will also have that functionality.

Michael on 24 Jun 2008 at 8:34 am

Thanks Mike. I was just about to play with the existing code. Will let you know how it goes.

Nita on 24 Jun 2008 at 9:12 am

Mike, I noticed that the previous and next button doesn’t seem to be working ok with slideshow2.

Nita on 24 Jun 2008 at 10:38 am

I was having trouble getting the large images to show. You demo was working but when I placed it on my page it failed
I changed line 12 in slide.js to the following

var id=t[i].getAttribute(’value’); tar[i]=id;

The previous code was giving back a value of ‘-1′. No idea why the demo worked and mine failed.
I’m using your code in a jsp environment to let people create their own slide shows. Thanks a million for the code.

Edwin on 24 Jun 2008 at 11:41 am

Does this use caching or that handled by the browser, it seems to download connect to the image/server each time it loads according to the status bar

Edwin on 24 Jun 2008 at 11:55 am

@Nita - I will dig into it a bit, hopefully I can get some time soon and get v2 completed and resolve any open issues.

@Edwin - Shoot me a link I would love to check it out. As for the caching, the browser should handle that. I have not run into an issue with caching thus far. Once the image is added it should never be downloaded again.

Michael on 24 Jun 2008 at 12:35 pm

Mike, I have noticed one problem with the javascript. The image slider(thumbnails) at the bottom breaks if the number of images is 12 or more. Don’t know why this thing is happening rest everything works great..good work

Sarab on 24 Jun 2008 at 7:54 pm

Mike, I tried adding scroll buttons both sides of the thumbnail slider,but it didn’t work properly. Can you help me with tht. Thanks

Sarab on 24 Jun 2008 at 8:09 pm

Hi Mike, this is what I did using your JS code. It is very slow when I browse, not sure why. Here is the link:http://www.naperville-lib.org/index1.htm Also it looks different in mozilla.

Thanks

Nita on 24 Jun 2008 at 9:31 pm

Mike, looping is not correct either. It does the first round properly and next time it loops from the second one.

Nita on 25 Jun 2008 at 10:56 am

is there a way I can add 2 sections for scrolling images? I’d like to have images up top and bellow but I seem to not be getting something right.

James on 25 Jun 2008 at 11:13 am

Mike, I was able to fix the code and it is working fine now, both previos and next button and also scrolling. thanks a lot for sharing the code with us. I like it very much.

Nita on 25 Jun 2008 at 8:49 pm

@Sarab - I have not seen that before, can you email me a link? I will take a look. If you explain your second request a bit better I would be glad to help when I get some time.

@Nita - Sorry for not getting back with you sooner, glad you worked it out. Just shoot me an email if you run into anything else.

@James - It can definitely be done, shoot me a link with what you have and I will try and point you in the right direction.

Michael on 26 Jun 2008 at 7:45 pm

Hi Mike..I increases the width of thumb div and it worked..But there is another problem i am facing now.. I am trying to align the image vertically @ the middle and center can you help me out with tht.
Thank you

Sarab on 27 Jun 2008 at 9:32 am

@Sarab - I need a link to look into it.

Michael on 27 Jun 2008 at 9:35 am

Hi Mike..Thanks for getting back. Heres the link–>http://np.ospreymedialp.com/PhotoGalleryBackup/PhotoGallery/slideshow/Default2.aspx . I want to align the image in the center and middle. Thanks

Sarab on 27 Jun 2008 at 9:47 am

Mike
The script works fine for big images but the small images are not placed vertically in the middle of the control. I tried changing the css a little bit but no luck with that.Your help will be appreciated.
Thanks

Sarab on 27 Jun 2008 at 11:15 am

Hi Mike, thats ok. can we open up the link in a new window? How to pass on the target attribute. I might be wrong, for one of the images I had a pretty long url, at this time it was not displaying the next image. So I created a temp page and in the temp page I am redirecting using window.open.
Have a nice weekend!

Nita on 27 Jun 2008 at 1:27 pm

Mike
here is a link to the gallery http://www.360-studios.com/kids I was able to add another row but wasn’t scrollable. Also have you seen anyone making these rows vertical? I’d like to make a row vertical on each side but figured making 2 horizontal would be enough for now.

James on 27 Jun 2008 at 1:47 pm

Great work!
But I can’t upload more than 55 images
Why?

Maxim on 29 Jun 2008 at 12:36 am

Thanks so much for sharing. This is just what I was looking for. I tweaked it to use for my own stuff and it looks great. I was able to use an iframe feature for it as well so it will work well in the website when it’s done. Thanks again…really appreciate it

Kimberly on 29 Jun 2008 at 2:40 pm

@Sarab - Let me know if you did not get me email.

@Nita - The JavaScript is just building out the link using standard DOM, if you look through the code you will see where it is being done and you can tweak it to open in a new window.

@Maxim - You probably just need to increase the width of the #thumbs in the CSS. Shoot me a message if you have problems.

Michael on 29 Jun 2008 at 6:29 pm

Great work!
thanks for the script ,
Actually i’m using this script in asp.net using c# and the thumb images are coming from database , upto tat point every thing is wroking when i click the thumb to get enlarge image is not wroking .

Plz help me if possible!!
Thanks

Mala on 30 Jun 2008 at 12:53 am

Beautiful script - lightweight, fast-loading - just what I was looking for. Thanks!

Tom on 30 Jun 2008 at 9:24 am

@Mala - I will need more info, code and a link. Shoot me an email with the details.

Michael on 30 Jun 2008 at 6:10 pm

Thank you for your DEMO . But. I am on IE7. Clicking the picture will present the dotted line frame. Is this a essential one?

If there are new editions, will you please send a EMAIL to me: cancanliunx_c110@hotmail.com. Thank you again. .

liucan on 02 Jul 2008 at 7:39 pm

Great script! thanks so much
I am also having an issue getting my images to center horizontally in the image area. I have portrait and landscape images and would jsut like them to all be centered. Any help with this would be wonderful.
Thanks so much

Bobbie on 03 Jul 2008 at 12:41 pm

@Bobbie - You might be able to work out the solution by using margin:0 auto on the image for the width but the height or the image would need to be calculated with the JavaScript, subtracted from the height of the container, and then divided by two. Shoot me an email if you can’t get it worked out.

Michael on 04 Jul 2008 at 8:16 am

First let me say thank you for posting this. I really don’t understand people like G. You didn’t have to share this, again thanks.

Now to my problem, it’s late on the 4th and I’m trying figure out how to use unique (non-sequential) names for the large images and am failing. Might be too tired to see it but help would be appreciated.

yankee on 04 Jul 2008 at 11:54 pm

This looks great and my question is gonna sound pretty stupid amongst experienced web designers, but i am an absolute beginner. I just wanted to ask if someone could walk me through implementing this into a simple html webpage. What code do i need to place in my index.html, to actually call your script to appear.
Cant wait to get this working, appologies for sounding stupid, but we all have to start somewhere .. thanks

Jay on 05 Jul 2008 at 5:39 pm

thanks to u
it’s really working well

hello on 06 Jul 2008 at 12:56 am

@Jay - If you download the zip you should get a pretty barebones example that you can migrate into your project. Shoot me an email if you have any specific questions come up.

Michael on 06 Jul 2008 at 2:03 pm

@Yankee - The current demo was created using numerics in mind. You might give http://sandbox.leigeber.com/slideshow2/ a try where you can use any kind of filename as well as links. Version 2 will also resolve the limitation.

Michael on 06 Jul 2008 at 2:05 pm

This is great stuff!

Thanks a bunch for sharing with us Michael.

I just have a little issue.

This bit below is conflicting with the onload event handler currently on my site:
<BODY onLoad=”initScrolling( );” >
window.onload=function(){slideShow.init(); slideShow.lim()};

Any way to reconcile the two?

I will appreciate a response.

Thank you again for this great code.

Ihechi on 07 Jul 2008 at 1:31 pm

Mike, I am having a problem. in IE 7 most of the time when I replace with new images, it doesn’t display one of the three images in the thumbnail section. It gives ci.id is null error. It works fine in Mozilla. Here is the link:http://www.naperville-lib.org/
I change the images quite often aleast twice a week, with new urls.

Thanks.

nita on 07 Jul 2008 at 8:29 pm

@Ihechi - You need to create one onload function that calls the two current onload functions. If that doesn’t make sense s