2011-08-14 29 views
0

我正在使用以下標記來設置我的jQuery循環幻燈片。但是,我想弄清楚如何用不同的圖像src實現縮略圖。如果我的放大圖像src是image-file-name.jpg,我怎樣才能用src-th-image-file-name.jpg調用縮略圖?jquery循環提前尋呼機 - 如何調用不同的縮略圖imagesource?

<script type="text/javascript"> 
$(document).ready(function() { 
$('#s2').cycle({ 
fx:  'fade', 
speed: 'slow', 
timeout: 0, 
next: '#next', 
prev: '#prev', 
pager: '#thumbs', 
after: onAfter, 

// callback fn that creates a thumbnail to use as pager anchor 
pagerAnchorBuilder: function(idx, slide) { 
return '<li><a href="#"><img src="' + jQuery(slide).find('img').attr('src') + '" width="140" height="140" /></a></li>'; } 

}); 


function onAfter(curr, next, opts, fwd) { 
var index = opts.currSlide; 
//$('#prev')[index == 0 ? 'hide' : 'show'](); 
//$('#next')[index == opts.slideCount - 1 ? 'hide' : 'show'](); 
//get the height of the current slide 
var $ht = $(this).height(); 
//set the container's height to that of the current slide 
$(this).parent().animate({height: $ht}); 
} 
}); 
    </script> 

回答

相關問題