Cycle: Start the slideshow from the thumbnail image clicked on

Cycle: Start the slideshow from the thumbnail image clicked on

I' have a masonry thumbnail gallery, and the thumbnails link to a jQuery Cycle slideshow. Originally, whatever thumbnail you click on the slideshow starts with the first slide. I'd like to make it so when you click on a thumbnail, it goes to the slideshow starting with that thumbnail image. I'm trying "startingSlide" option of Cycle. Also, the site is built with Wordpress. 

This is in my thumbnail gallery template: 

  1. <div class="m_item">
  2. <a href="http://paraboladesignstudio.ipage.com/yahaira/fashion/fashion-slideshow/?thumb=1">
  3. <img src="<?php echo $image['url'];?>" title="<?php echo $image['title'];?>" alt="<?php echo $image['alt']; ?>">
  4. </a>
  5. </div>
And this in my slideshow template:

  1. <ul class="slideshow">
  2.     <?php 
  3.         $thumb = $_GET["thumb"];

  4.         $firstImage = $images[$thumb-1];
  5.         //echo first image here

  6.         for($i = 0; $i < count($images); $i++): 

  7.         if($i == ($thumb-1)) continue;
  8.         $image = $images[$i];
  9.     ?>
  10. <li>
  11. <table>
  12. <tr>
  13. <td>
  14. <div class="slideshow_image" data-startingslide="<?php echo $thumb; ?>"><img src="<?php echo $image['url'];?>" alt="<?php echo $image['alt']; ?>"></div>
  15. </td>
  16. </tr>
  17. </table>
  18. </li>
  19. <?php endfor; ?>
  20. </ul>
And this in my javascript file:

  1. var startingSlide = $('.slideshow_image').data('startingslide');
  2. $(slideshowContainer).cycle ({
  3. fx: slideshowFx,
  4. delay: slideshowDelay,
  5. speed: slideshowSpeed,
  6. timeout: slideshowTimeout,
  7. containerResize: 0,
  8.         startingSlide: startingSlide,
  9. fit: 0,
  10. slideResize: 0,
  11. height: _h,
  12. width: _w,
  13. cleartype: true,
  14. cleartypeNoBg: true,
  15. next: slideshowNextBtn,
  16. prev: slideshowPrevBtn,
  17. before: function(curr, next, opts) {
  18. $(slideshowShareLink).removeClass('sel');
  19. $(slideshowShareContainer).css({'visibility':'hidden'});
  20. preLoadImage(opts.currSlide, opts.slideCount);
  21. $('.slideshow_title').html($(next).data('title'));
  22. },
  23. after: function(curr,next,opts) {
  24. onAfter(curr,next,opts);
  25. }
  26. });