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

October 2, 2007

jQuery: jqGalViewII (Photo Gallery)

This is the jQuery Gallery View II plugin (jqGalViewII) which takes a list of your images and creates an easily styles photo gallery. This plugin will preload all of your larger images for faster viewing.

The Head

JavaScript:
  1. <script type="text/javascript" src="http://code.jquery.com/jquery-latest.pack.js"></script>
  2. <script type="text/javascript" src="common/js/jqGalViewII.pack.js"></script>
  3. <script type="text/javascript">
  4. $(document).ready(function(){
  5.     $('#demo').jqGalViewII();
  6. });
  7. </script>

HTML:
  1. <style type="text/css" media="screen">
  2. <!--
  3. @import url("common/css/jqGalViewII.css");
  4. -->
  5. </style>

The Body

HTML:
  1. <ul title="My Gallery">
  2.     <li><a href="http://lh6.google.com/sterling.benjamin/RuyW_7tKn8I/AAAAAAAAAVc/opzOXldgJ0Y/DSC_0001.JPG?imgmax=800"><img src="http://lh6.google.com/sterling.benjamin/RuyW_7tKn8I/AAAAAAAAAVc/opzOXldgJ0Y/s72/DSC_0001.JPG" alt="Yes, I do know what I am doing!" width="72" height="48" border="0"/></a></li>
  3.     <li><a href="http://lh5.google.com/sterling.benjamin/RuyYPrtKn9I/AAAAAAAAAWE/Y1kITpSTFXI/DSC_0025.JPG?imgmax=800"><img src="http://lh5.google.com/sterling.benjamin/RuyYPrtKn9I/AAAAAAAAAWE/Y1kITpSTFXI/s72/DSC_0025.JPG" alt="Hey, it is better then reversible diapers!" width="72" height="48" border="0"/></a></li>
  4.     <li><a href="http://lh4.google.com/sterling.benjamin/RuyZObtKoAI/AAAAAAAAAWc/dDMbJK0jSlw/DSC_0004.JPG?imgmax=800"><img src="http://lh4.google.com/sterling.benjamin/RuyZObtKoAI/AAAAAAAAAWc/dDMbJK0jSlw/s72/DSC_0004.JPG" border="0"/></a></li>
  5.     <li><a href="http://lh6.google.com/sterling.benjamin/RuyZa7tKoBI/AAAAAAAAAWo/dmnMNJS2nPI/DSC_0005.JPG?imgmax=800"><img src="http://lh6.google.com/sterling.benjamin/RuyZa7tKoBI/AAAAAAAAAWo/dmnMNJS2nPI/s72/DSC_0005.JPG" border="0"/></a></li>
  6.     <li><a href="http://lh3.google.com/sterling.benjamin/RuyZnLtKoCI/AAAAAAAAAWw/1TD-_nNT8PA/DSC_0006.JPG?imgmax=800"><img src="http://lh3.google.com/sterling.benjamin/RuyZnLtKoCI/AAAAAAAAAWw/1TD-_nNT8PA/s72/DSC_0006.JPG" width="72" height="48" border="0"/></a></li>
  7. </ul>

And that would produce the following:

  • Yes, I do know what I am doing!
  • Hey, it is better then reversible diapers!
  • 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!
  • 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 Downloads

Download zip with demo and styles: http://bs-jquery-plugins.googl.....II.1.0.zip
The jQuery core is available at: http://code.google.com/p/jqueryjs/downloads/list.



Pages: « 1311 10 9 8 7 [6] 5 4 3 2 1 » Show All

121 Responses to “jQuery: jqGalViewII (Photo Gallery)”

Hello Again,

Sorry for posting so much, I think I have figured it out, I altered the line you gave me from:

CODE:
  1. var newsrc = src[0] + '_large.' + src[1];

to:

CODE:
  1. var newsrc = src[0] + src[1] + src[2] + '.large.' + src[3];

The URL seems to be displaying correctly now. I am not sure if this is the correct way of doing it, but it worked for now. Now I just need to get it to load in Thickbox, is this something you would know or should i check the Thickbox forums.

Thanks and sorry for bothering you so much.

Looked more into it and it looks like split was misspelled, once i renamed it to split from slit it started alerting me with the address. Unfortunately the address isn't correct. Also is this code supposed to trigger the Thickbox or just call the URL.

Thanks

Nice, that fixed the image issue, any clue regarding the Thickbox code?

@Robert:
There was a error in the code, change line 112 of your jquery.galview2.js file to:

JavaScript:
  1. this.altImg = this.src.replace(el.opts.prefix,'');

@Scott: Take a look at http://junktrunk.com/, he did a real nice job with the layout. That may help you.

Unfortunately I have not been able to get either issues working. Whenever I add the code to automatically remove the .thumb from the src the page just loads with a broken image link. Also the Thickbox code is not doing anything. Any ideas? My test site is located here: http://media.primetimesolutions.net/staging/

ah. awesome! that worked!

one other question. Is there anyway to have the thumbnails go vertical next to the main image instead of horizontal?

Scott:
Thanks for the kind words.

Two things, you show reverse the order of your script tags, put the jquery-1.2.1.pack.js before the jqGalViewII.js and remove the script tag just before the UL. And that should put you in the right place.

hey,

I'm trying out your layout. It's exactly what I need but I can't for the life of me figure out how to implement this. Are there extra instructions I'm missing. I'm trying to get to work here: http://www.sthig.com/delaine but nothing is coming out right. I'm sure I'm missing a step somewhere. Can you help me out what I'm supposed to do?

thanks!
Scott

ps-this looks AWESOME and I'd love to use it!

Robert:
First off, thank you very much for the donation, I truly appreciate it.

if you have your thumbnails as being image_small.jpg and image.jpg is the large image you want to show and image_large.jpg is the thickbox image, which I am assuming is the case, you can do something like this:

JavaScript:
  1. $('#gallery').jqGalViewII({getUrlBy:2, prefix:'_small'});

That will replace the _small and return image.jpg.

Now to get the larger to open in thickbox, this is untested, add the follow at about line 198, after fadeOut function:

JavaScript:
  1. el.image.unbind('click').click(function(){
  2.     var src = $(this).attr('src').slit('.');
  3.     var newsrc = src[0] + '_large.' + src[1];
  4.     alert(newsrc); // just for testing
  5.     // thickbox execution code
  6. });

Try that out and let me know if that works out for you.

Hello,

I am working on a new product page for our site and am using your amazing plug in to add the ability of multiple images. I have a few questions though, Is there a way to make it so if you click on the large version of the image, it opens a larger version in Thickbox. Also our images are name image_small.jpg,image.jpg image_large.jpg I was wondering if there is any way to get this to work with the prefix setting in your code.

PS: To thank you for this great plug in my company will be sending a donation.

Pages: « 1311 10 9 8 7 [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

42 queries. 1.194 seconds. Powered by WordPress visitor stats