views:

390

answers:

1

Another thanks to SLaks for helping me get the code this far.

I'm not quite sure if my last step is even possible with the way I have things set up.

A live version of the gallery can be seen here: http://www.studioimbrue.com/index2.php

Currently, everything works appropriately. The image and its thumbnail are currently tied together, but the jCarousel itself is still independent. I've added nextThumb.closest('.thumbscontainer').jcarousel('next'); so that when you click the large image, the carousel scrolls to the next row, but that doesn't actually follow any pattern. What I'm attempting to do is for jQuery to detect how far down the thumbnail is and when to appropriately scroll the carousel. Is this even possible?

A: 

Perhaps this example will help: http://sorgalla.com/projects/jcarousel/examples/static_controls.html

You'll need to figure out the index of the "next" image, then pass that index to scroll().

Update:

Try replacing

nextThumb.closest('.thumbscontainer').jcarousel('next');

with

nextThumb.closest('.thumbscontainer').jcarousel('scroll', nextThumb.index() + 1);
Jeffery To
Hm... very interesting. I didn't realize it was that flexible. Sadly, as I told SLaks, my javascript knowledge is definitely lacking. I'm not yet to the point where I can utilize jQuery's indexing. If anyone has the time to take a stab at it, I would be extremely grateful.
steve
You, sir, are a genius. That was actually much easier than I thought. I was overthinking that by a mile. I have a lot to learn I guess.
steve
Quick question: is there a way to get that to work in multiples of four? Instead of every time you click it scrolls up one, can I make it so on the fourth one of each column it scrolls up to that one? Not necessary, I just think it may make things more fluid
steve
I don't think there's an easy way to do it. You'd need to keep track of which thumbnail to really scroll to show each thumbnail.
Jeffery To