简体   繁体   English

jcarousel图像在滚动事件后消失

[英]jcarousel images disappear after scroll event

I have an autocomplete text input that triggers a slider using jcarousel to scroll to the image of the selected person. 我有一个自动完成的文本输入,可以触发使用jcarousel滚动到所选人物图像的滑块。 The problem is, if you search once, it works, but searching again makes all the images disappear. 问题是,如果您搜索一次,它将起作用,但是再次搜索会使所有图像消失。

Here is the code that controls the input: 这是控制输入的代码:

jQuery('#team_select2').change(function() {

    var idx = $('#team_select2').val();

    if(idx == '')
    {
        carousel.scroll(1);
        $('.details').hide();
        return false;
    }

    carousel.scroll(idx);
    $('.details').hide();
    $('#'+idx+'_details').show();
});

You can see it breaking in action if you go to http://welchhornsby.com/new-team-page/ and try searching for two of the people in the list. 如果您转到http://welchhornsby.com/new-team-page/并尝试在列表中搜索其中两个人,则可以看到它发挥了作用。

Anyone have any idea why it would be breaking like that? 任何人都知道为什么会那样破裂吗?

Found the answer right after posting this. 发布此答案后立即找到答案。 Just changed the 4th to last row from carousel.scroll(idx); 只是将carousel.scroll(idx);的第四行更改为最后一行carousel.scroll(idx); to carousel.scroll(idx*1); carousel.scroll(idx*1);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM