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 9, 2007

jQuery: jqGalScroll v2.1 (Photo Gallery)

jQuery Gallery Scroller (jqGalScroll) takes list of images and creates a smooth scrolling photo gallery scrolling vertically, horizontally, or diagonally. The plugin will also create pagination to allow you to flow through your photos.

The Head

JavaScript:
  1. <script type="text/javascript" src="jquery.js"></script>
  2. <script type="text/javascript" src="jqGalScroll.js"></script>
  3. <script type="text/javascript">
  4.     $(document).ready(function(){
  5.         $("#demoOne").jqGalScroll();
  6.     });
  7. </script>

CSS:
  1. <style>
  2.     @import url("common/css/jqGalScroll.css");
  3. </style>

The Body

HTML:
  1. <ul id="demoOne">
  2.     <li><img src="http://farm3.static.flickr.com/2139/2038186348_58925c20ca.jpg" border="0"/></li>
  3.     <li><img src="http://farm3.static.flickr.com/2194/2037390693_8acc544048.jpg" border="0"/></li>
  4.     <li><img src="http://farm3.static.flickr.com/2156/2037392621_c64ae1ca81.jpg" border="0"/></li>
  5.     <li><img src="http://farm3.static.flickr.com/2409/2037390277_1097dff9e5.jpg" border="0"/></li>
  6.     <li><img src="http://farm3.static.flickr.com/2403/2134348146_fd6a7d0e74.jpg" border="0"/></li>
  7.     <li><img src="http://farm3.static.flickr.com/2217/2134343276_2fd803b40e.jpg" border="0"/></li>
  8.     <li><img src="http://farm3.static.flickr.com/2032/2133564381_4a1f66bfbb.jpg" border="0"/></li>
  9. </ul>

The Outcome

Options

Below are a list of options you can pass to the jqGalScroll plugin.

JavaScript:
  1. ease: null,
  2.     speed:0,
  3.     height: 500,
  4.     width: 500,
  5.     titleOpacity : .60,
  6.     direction : 'horizontal' // vertical horizontal diagonal

Styling

I am in no way a great designer, so the example is very bare, but the follow urls are sites that done a nice job with the plugin:

Thanks

Koes put a fire under my butt to improve this plugin and when I took too long he took what I had and added the horizontal scroll and in turn I ripped it from his hands and made it better :) http://www.koesbong.com/

Download

The jqGalScroll v2.1 Plugin is available at: http://bs-jquery-plugins.googl.....ll.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.



Pages: « 1412 11 10 9 8 [7] 6 5 4 3 21 » Show All

132 Responses to “jQuery: jqGalScroll v2.1 (Photo Gallery)”

koesbong: I working on getting your version into my WP plugin PhotoXhibit

Hey Ross,

As mentioned by Ben, feel free to take a look at the gallery I've created based on Ben's jgGalScroll. Feel free to email me if you have any questions on that as well. my email is my name stated above at gmail.com

It did, I have not had time to post the code yet, I can send you what koesbong did (http://www.ryanbrenizer.com/).

Did the left to right issue ever get fixed? The images won't stack up left to right for me.

David, do take koesbong on his offer, he made some really nice additions to the code that I am looking to add as soon as things die down for me.

koesbong: a huge hat tip to you for your work, I do appreciate it.

David, change line 13 from "filter" to "find" and see if that works.

Hey David,

I had this problem before. try this:

Try changing:

el.pagination.filter('.selected').removeClass('selected');

to

el.pagination.find('.selected').removeClass('selected');

i can email you my modified version of jqGalScroll if you'd like. my email is my name stated above at gmail.com

Hello Benjamin,

I try to make the links selected, but I can't.
Once a link is clicked, the older selected link stays selected...

I took a look at your older script : http://benjaminsterling.com/ex.....lScroll.js
and the lines :

CODE:
  1. var $ul = $('');
  2.            
  3.             for(var i = 0; i &lt;$children.size(); i++){
  4.                 var selected = '';
  5.                 if(i == 0) selected = 'selected';
  6.                
  7.                 var $a = $('<a href="#'+(i)+'" rel="nofollow">'+(i+1)+'</a>').css({opacity:.70});
  8.                 $ul.append($a);
  9.             };
  10.             $jqgsPagination.append($ul)
  11.             var $jqgsPaginationLinks = $jqgsPagination.find('a').click(function(){
  12.                 var href = this.href.replace(/^.*#/, '');
  13.                 $jqgsPaginationLinks.filter('.selected').removeClass('selected');
  14.                 $(this).addClass('selected');
  15.                 $parent.animate({marginTop:-($children.height()*href)},o.speed, o.ease);
  16.                 $.fn.jqGalScroll.getTitle($children[href],$jqgstitle);
  17.                 index = href;
  18.             });

but I dont know what to change in your last script (i'm not good in javascript...)

Thanks for your help

David

[...] jQuery lightBox plugin. jQuery Image Strip. jQuery slideViewer. jQuery jqGalScroll 2.0. jQuery - jqGalViewII. jQuery - jqGalViewIII. jQuery Photo Slider. jQuery Thumbs - easily create [...]

[...] jqGalScroll 2.0 (Photo Gallery) Diese Bildergalerie von Benjamin Sterling scrollt ebenfalls, diesmal aber vertikal. [...]

Pages: « 1412 11 10 9 8 [7] 6 5 4 3 21 » 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

45 queries. 1.486 seconds. Powered by WordPress visitor stats