Kevin Daniel
Kevin Daniel

Reputation: 431

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. 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.

Anyone have any idea why it would be breaking like that?

Upvotes: 2

Views: 267

Answers (1)

Kevin Daniel
Kevin Daniel

Reputation: 431

Found the answer right after posting this. Just changed the 4th to last row from carousel.scroll(idx); to carousel.scroll(idx*1);

Upvotes: 1

Related Questions