开发者

carouFredSel current image caption

I was wondering if any of you are familiar with the carouFredSel script. I love the script but I am struggling to extract the number of the current slide, so I can show a caption.

The problem I'm having is that I show 3 slides next to each other and the script loads the caption for EACH of the slides, instead of showing only th开发者_高级运维e one in the middle. I can't even figure out how to grab the current item number so that I could use it to fadeIn the correct caption...


you can use $("#thumbs").triggerHandler("configuration", "items.visible"); to get no of visible items. Do Math.floor() to get middle element on it. and $('#thumbs').trigger('slideTo', [$(this),-mid_element]);

I managed to get something here , may its helpful to you

http://jsfiddle.net/RL8MV/12/

though its a late reply.. may be helpful someone else. :P


To get middle element

// Calculate the center carousal
function getCenterThumbnail() {
var $thumbnail =  $('#thumbnail'),
    $visible = $thumbnail.triggerHandler( 'currentVisible' ),
    center = Math.floor($visible.length / 2);
  return center;
}

and to slide to middle

$('#thumbnail').trigger( 'slideTo', [ +position, -center ] );

position is current element (image) position.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜