Image gallery using jQuery

7 posts by 4 authors in: Forums > CMS Builder
Last Post: March 4, 2011   (RSS)

By Kittybiccy - January 21, 2011

I've got a little gallery working in HTML but am wondering how I would be able to get it to work when using CMS Builder. The jQuery crops the image to create a thumbnail and displays the large image on click of the thumbnail but it uses the 'div id, and number of images' in the bit of code:

<div class="photos">
<div id="photo_1"><img src="images/leeds_castle_1.jpg" width="640" height="355" border="0" /></div>
<div id="photo_2" style="display:none;"><img src="images/leeds_castle_2.jpg" alt="" /></div>
<div id="photo_3" style="display:none;"><img src="images/leeds_castle_3.jpg" alt="" /></div>

<ul class="thumbs">
<li><a href="javascript:void(0)" onClick="switch_product_img('photo_1', 3);"><img src="images/leeds_castle_1.jpg" /></a></li>
<li><a href="javascript:void(0)" onClick="switch_product_img('photo_2', 3);"><img src="images/leeds_castle_2.jpg" alt="" /></a></li>
<li><a href="javascript:void(0)" onClick="switch_product_img('photo_3', 3);"><img src="images/leeds_castle_3.jpg" alt="" width="340" height="355" /></a></li>
</ul>

Any ideas how the CMS code would be implemented and how we could get it to work for a varying number of images (the client needs flexibility to add in as many images as needed)? Thanks in advance!

Re: [Kittybiccy] Image gallery using jQuery

By gkornbluth - January 21, 2011

Hi,

I'm assuming that a simple multirecord editor with image uploads and detail pages won't work for some reason.

Have you tried something like Thumbnail Viewer II from DynamicDrive?

You can see an implementation of it at http://www.susansaladino.com/portfolio.php

Both approaches can handle an unlimited number of images. They can be set up to display only a certain number of thumbs on a given page with next and previous page links.

There's lots of information on both approaches in my CMSB Cookbook

Best,

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] Image gallery using jQuery

By Kittybiccy - January 21, 2011

Hi Jerry,

The page itself will be one of many detail pages with an upload field. The main reason I wanted to use that bit of jQuery was because of how it uses the large image to create the thumbnail using CSS to hide the overflow. Does the one you mention do similar? I just don't like using the CMSBuilder to create thumbnails as these end up different proportions!

Thanks!

Re: [Kittybiccy] Image gallery using jQuery

By gkornbluth - January 21, 2011

Hi,

When CMS creates thumbnails, you set up the parameters for max W and max H (up to 4 sets of sizes in all). If you want the thumbs to all be the same H and W you'd have to start off with identical aspect ratios for the larger ones.

Otherwise, all crop algorithms, including the jQuery one used by CMSB, do not change the aspect ratio but shrink the longest side of the image to the pixel size that you've set.

All the examples use thumbs created in CMSB.

Did you look at the sample page that I mentioned?

Jerry
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] Image gallery using jQuery

By Codee - March 3, 2011

Hi Jerry, I haven't checked yet but does your CMSBCookbook walk through using the same dynamic drive image gallery setup as the saladino site? Thanks!

Re: [equinox69] Image gallery using jQuery

By gkornbluth - March 4, 2011

Yes it does and it's been updated to use jQuery

The recipe is called:

"USING DYNAMIC DRIVE IMAGE THUMBNAIL VIEWER II"

Jerry
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php