【问题标题】:JQuery roundabout - getting ID of selected <lI> each time the roundabout finishes movingJQuery环形交叉路口 - 每次环形交叉路口完成移动时获取所选<lI>的ID
【发布时间】:2012-02-01 19:02:19
【问题描述】:

我使用的 JQ 环岛插件来自:

http://fredhq.com/projects/roundabout/

已设置并正常工作 - 但难以让其中一个可挂钩事件正常工作。 任何演示中都没有真正的语法示例,所以这可能只是我的愚蠢。

我正在按如下方式启动环岛:

<script>
    $(document).ready(function() {

    $('#productRoundel').roundabout(
        {
            shape: 'tearDrop',
            focusBearing: '5.0'
        });

    $("#productRoundel").roundabout.animationEnd(function() {

        alert("hello");

    }); 

});
</script>

谁能给我一个关于正确语法的指针,以便在动画完成后触发事件,以便我可以获取当前幻灯片的 ID?

谢谢, 史蒂夫

【问题讨论】:

    标签: jquery syntax


    【解决方案1】:

    免责声明:我没有测试或使用过这个插件,但你应该可以绑定到事件来监听它。

    <script>
        $(document).ready(function() {
    
        $('#productRoundel').roundabout(
            {
                shape: 'tearDrop',
                focusBearing: '5.0'
            });
    
        $("#productRoundel").bind( 'animationEnd', function() {
    
            alert("hello");
    
        }); 
    
    });
    

    【讨论】:

    • 谢谢科里。出于某种原因,绑定解决方案完全逃脱了我 - 一定是度过了糟糕的一天!这非常有效。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-03
    • 2011-02-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多