views:

29

answers:

1

Hi all,

i have create a gallery with jquery.

http://www.rialto-design.de/endkunden/galerie/galerie-armaturen/?album=3&gallery=2

so my question is, how can i make the thumbs scroll left or right. when the cursor is on the right or left side of the container.

alt text

Important is, the thubs are still clickable.

Thx

+1  A: 

Try adding the code below, then removing the img_forward and img_back hover functions.

var overview = $('.ngg-galleryoverview'),
 // vp = viewport width
 vp = overview.width(),
 // edgeMargin = margin to add on either side of the thumbs
 edgeMargin = 20,
 // maxw = width of all thumbs together side-by-side
 maxw = $('.gallery_thumbs').css('padding','0 ' + edgeMargin + 'px').outerWidth();

 overview.bind('mousemove', function(e){
  overview.scrollLeft( (e.pageX - overview.offset().left) * (maxw - vp) / vp );
 });

Update: Added comments to the code to prevent someone in the future from cursing my name trying to figure out what is going on.

fudgey
thank you very much!!!!
Fincha