Skip to content Skip to tags Skip to twitter news Skip to blog roll Skip to categories Skip to archives Skip to recent posts

September 30, 2007

Image/Photo Gallery Viewer using jQuery

jqGalView Overview

The jQuery jqGalView Plugin allows you to take a grouping of images and turn it into an flash-like image/photo gallery. It allows you to style it how ever you want and add as many images at you want.

Inspired by http://www.flashimagegallery.com/pics/artwork/!

Feel free to vote for this plugin over at http://ajaxrain.com/search.php?seVal=jqGalView

The jQuery jqGalView Plugin's purpose is to be unobtrusive as possible and after looking at a lot of static photo galleries I feel the jQuery Gallery Viewer does just that. It takes any current structure and rips out the images and any parent link and turns a static photo gallery in to a dynamic flash-like gallery.

I tried to make this plugin as easy and flexible to you, for example, doing:

The head stuff
JavaScript:
  1. <script type="text/javascript" src="/articles/common/js/jquery-1.2.1.pack.js"></script>
  2. <script type="text/javascript" src="/articles/jqGalView/common/js/jqGalView.js"></script>
  3. <script type="text/javascript">
  4.     $(document).ready(function(){
  5.         $("#example1").jqGalView();
  6.     });
  7. </script>

The xhtml
HTML:
  1. <ul id="example1" title="My Gallery">
  2. <li><a href="PathToFullSizeImage"><img src="PathToFullThumbnailImage" alt="Some alt text" width="144" height="96" border="0"/></a></li>
  3. <li><a href="PathToFullSizeImage"><img src="PathToFullThumbnailImage" alt="Some alt text" width="144" height="96" border="0"/></a></li>
  4. <li><a href="PathToFullSizeImage"><img src="PathToFullThumbnailImage" alt="Some alt text" width="144" height="96" border="0"/></a></li>
  5. </ul>

Will produce the following, with styling and more images of course




  • Yes, I do know what I am doing!
  • Hey, it is better then reversible diapers!
  • It... it smells like... old cheese in here...
  • Everyone looks good through a glass of beer!
  • Is he going to eat me?!
  • It's like talking to a wall!!!
  • This is my seductive look! It works on all the boys.
  • You won't like me when I'm angry!
  • It is out of focus; let me help.
  • I always have to carry the conversation; they never say anything.
  • I SAID CLOSER!!!
  • I think I may be getting the upper hand here...
  • I'm being attacked and your taking pictures?
  • Yes, I do know what I am doing!
  • Hey, it is better then reversible diapers!
  • It... it smells like... old cheese in here...
  • Everyone looks good through a glass of beer!
  • Is he going to eat me?!
  • It's like talking to a wall!!!
  • This is my seductive look! It works on all the boys.
  • You won't like me when I'm angry!
  • It is out of focus; let me help.
  • I always have to carry the conversation; they never say anything.
  • I SAID CLOSER!!!
  • What way is this supposed to go?
  • I think I may be getting the upper hand here...
  • I'm being attacked and your taking pictures?
The Small Print

So you see, it is pretty simple to take your list/group of images and turn it into a nice photo gallery with some styles. In this instance, it is taking the images you have in a unordered list, but you are not limited to that at all. You can do a table:

HTML:
  1. </p>
  2. <table title="This is a title">
  3. <td><img src=""/></tr>
  4. </table>

It can just be a div:

HTML:
  1. </p>
  2. <div title="this is a div title"><img src=""/></div>

In our first example you see that I am using an image wrapped in A tag, this is the default setting where you don't need to do anything other then $('#mygallery').jqGalView(); (ok, it may be a good idea to style things). Check out the Option tab to see a list of parameters that can be used to further customize your Web Album/Photo gallery and check out some more demos under, you guessed it, Demo.

The Demo(s)

The below implementation...

JavaScript:
  1. <script type="text/javascript">
  2.     $(document).ready(function(){
  3.         $("#example2").jqGalView({
  4.             modal:true,
  5.             title:"This is a new title",
  6.             openTxt:"Open me!!!!",
  7.             backTxt:"Go back to the thumbnails",
  8.             goFullSizeTxt:"Bigger Image",
  9.             tnease:"backinout"
  10.         });
  11.     });
  12. </script>

will produce below

  • Yes, I do know what I am doing!
  • Hey, it is better then reversible diapers!
  • It... it smells like... old cheese in here...
  • Everyone looks good through a glass of beer!
  • Is he going to eat me?!
  • It's like talking to a wall!!!
  • This is my seductive look! It works on all the boys.
  • You won't like me when I'm angry!
  • It is out of focus; let me help.
  • I always have to carry the conversation; they never say anything.
  • I SAID CLOSER!!!
  • I think I may be getting the upper hand here...
  • I'm being attacked and your taking pictures?
  • Yes, I do know what I am doing!
  • Hey, it is better then reversible diapers!
  • It... it smells like... old cheese in here...
  • Everyone looks good through a glass of beer!
  • Is he going to eat me?!
  • It's like talking to a wall!!!
  • This is my seductive look! It works on all the boys.
  • You won't like me when I'm angry!
  • It is out of focus; let me help.
  • I always have to carry the conversation; they never say anything.
  • I SAID CLOSER!!!
  • What way is this supposed to go?
  • I think I may be getting the upper hand here...
  • I'm being attacked and your taking pictures?

Downloads

Download zip with demo and styles: http://bs-jquery-plugins.googl.....ew.2.1.zip
The jQuery core is available at: http://code.google.com/p/jqueryjs/downloads/list.
The jQuery Easing Plugin v1.1.1 is available at: http://gsgd.co.uk/sandbox/jquery.easing.php.
The jQuery jqModal Plugin v2007.08.17 +r11 is available at: http://dev.iceburg.net/jquery/jqModal/.

Pages: [6] 5 4 3 2 1 » Show All

60 Responses to “Image/Photo Gallery Viewer using jQuery”

Hi all

I'm having the same problems than graham below.

When I refresh the page with CTRL-F5 the page loads correctly.

Any ideas?

Thanks in advance.

and please tell me how to put to put a x button because most people don't know how to exit view full size...sorry for my bad english...thanks again

i have a question i'm using jqgalview with jqmodal and i don't know how to change the dimension of the picture...when i click on view full size i want the picture to be bigger than it's right now...so...what files should i edit?thank you

[...] Image/Photo Gallery Viewer- [...]

very cool!
munch tks!

Hi there,

Thanks for a great plugin. However, I have encountered a weird problem in IE6 / IE7. I have a gallery on a page of a site I am building for a friend. However when I navigate away to another page on the site and then come back, the gallery breaks and i get this error:

Line: 256, Char:19, Object doesn't support this property or method

It works fine in FF / Safari.... Not sure what is going on!

Any ideas??

Thanks for your time
Graham

oh nevermind, i figured it out.
sorry about that!

Hey, really great job on the gallery!

I did a good amount of modifying and everything seems to be working very smoothly. My only question is would it be possible to get captions for each individual picture in any way.

Thanks!

Probleme resolved... in fact, when trying to access the website by 127.0.0.1, it doesn't work, but it's good with localhost :(
always good to know about it
ANYWAY, IT'S A VERY GREAT WORK !

Great plugin, very good work, but I've got a strange probleme, the gallery looks great on firefox, but it's bad displayed under IE!
I have done minor changes on the css and js file (change the link from bigger view to add to basket, and change the background style of the div (the green layout)
Furthermore, even when I download the original version of the files ( this link :http://bs-jquery-plugins.googlecode.com/files/jqGalView.2.1.zip) I meet again the same probleme with IE, anyone got an idea an can help me ?

Pages: [6] 5 4 3 2 1 » Show All

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

RSS Feed Link

41 queries. 0.730 seconds. Powered by WordPress visitor stats