如何使用roundabout.js显示每个焦点的隐藏字幕?

时间:2012-02-06 19:33:45

标签: jquery html focus show blur

目前我的设置是这样的。

<ul id="slide">
<li><img src=""><div class="info">TEST1</div></li>
<li><img src=""><div class="info">TEST2</div></li>
</ul>

但我想要这样。

<ul id="slide">
<li><img src=""></li>
<li><img src=""></li>
</ul>

<ul id="slideinfo">
<li><div class="info">TEST1</div></li>
<li><div class="info">TEST2</div></li>
</ul>

所以关注焦点,如果模糊隐藏,则显示第一个div&#39;然后显示下一个。 这是js。 http://fredhq.com/projects/roundabout#/api

2 个答案:

答案 0 :(得分:4)

将ID添加到幻灯片信息div ...如id =“info-1”等,这样您就知道要显示哪个标题

//roundabout update info
var currentChild = 0;


//on the start of the animation, all captions will be erased

    $("ul#slide").bind( 'animationStart', function() {

        $(".info").fadeOut('fast');
    });

//on the end of the animation, the caption corresponding to the slide will fade in

    $("ul#slide").bind( 'animationEnd', function() {

       currentChild = $("ul#slide").roundabout("getChildInFocus");


            $("#info-"+currentChild).stop().fadeIn('fast');
    });

答案 1 :(得分:0)

从id =“info-0”开始计数。否则字幕将无法正确显示。