TypeError: this.list(...).position(...) is undefined

352 Views Asked by At

I'm getting thrown the error TypeError: this.list(...).position(...) is undefined.

I'm trying to append the images returned from this JSON file to a carousel object and display it.

function getMuseumImages(selected_museum) {

        var jcarousel = $('.jcarousel').jcarousel();

        $('.jcarousel-control-prev')
                .on('jcarouselcontrol:active', function() {
                        $(this).removeClass('inactive');
                })
                .on('jcarouselcontrol:inactive', function() {
                        $(this).addClass('inactive');
                })
                .jcarouselControl({
                        target: '-=1'
                });

        $('.jcarousel-control-next')
                .on('jcarouselcontrol:active', function() {
                        $(this).removeClass('inactive');
                })
                .on('jcarouselcontrol:inactive', function() {
                        $(this).addClass('inactive');
                })
                .jcarouselControl({
                        target: '+=1'
                });

                var setup = function(data){
                    var html = '<ul>';

                    $.each(data.museums, function(){
                        html += '<li><img src=""' + this.images.url + '""></li>';

                    });

                    html += '</ul>';
                    jcarousel.html(html);
                    jcarousel.jcarousel('reload');
    };
$.getJSON('museums.php', setup);

}

0

There are 0 best solutions below