akaymaz / galleriffic

Automatically exported from code.google.com/p/galleriffic
0 stars 0 forks source link

can't make next button load external link #85

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have a series of galleries on separate pages, each using gallerific. I would 
like to make it so that 
when I scroll to the end of one gallery (gallery1.html) using the next > link, 
the page will redirect to 
the next gallery (gallery2.html) and so forth. Also would like to be able to go 
backwards on the < 
prev click when you reach the first image.

Is this possible. Can you attach a redirect to those navigations? Ive looked in 
the code, but cant 
figure it out without breaking it. 

Thanks!

Original issue reported on code.google.com by berowray...@gmail.com on 2 Feb 2010 at 2:51

GoogleCodeExporter commented 9 years ago
You can do this with the onSlideChange callback. I've set it up exactly like 
this for a comic book reader. 

My particular solution was to do this:
onSlideChange:             function(prevIndex, nextIndex) {
               // 'this' refers to the gallery, which is an extension of $('#thumbs')
               this.find('ul.thumbs').children()
                  .eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end()
                  .eq(nextIndex).fadeTo('fast', 1.0);
               // alert(prevIndex + " " + nextIndex);
               if (firstTime) {
                  firstTime = false;
               } else if ((nextIndex == 0) && (prevIndex == numpages)) {
                  issuenum++;
                  if (issuenum > <?php echo $max_issue; ?>) issuenum = 1;
                  window.open("index.php?issue_no=" + issuenum + "#0", "_top");
               } else if ((nextIndex == numpages) && (prevIndex == 0)) {
                  issuenum--;
                  if (issuenum < 1) issuenum = <?php echo $max_issue; ?>;
                  window.open("index.php?issue_no=" + issuenum, "_top");
               }
           },

which is really specific to my application, but you could finagle that too work.

Original comment by jack.sta...@gmail.com on 12 Feb 2010 at 6:22