Anatoly
Anatoly

Reputation: 5243

angular-carousel doesn't work

I'm trying to implement carousel by using angular-carousel plugin and nothing works, just empty screen.

This is my html code:

<body ng-app="carouselApp">
        <div ng-controller="carouselController">
            <ul rn-carousel>
                <li>
                    <img alt="" src="http://image.shutterstock.com/display_pic_with_logo/1860644/294403301/stock-photo-soup-vegetable-soup-bowl-294403301.jpg">
                </li>
                <li>
                    <img alt="" src="http://image.shutterstock.com/display_pic_with_logo/511399/210391630/stock-photo-grilled-chicken-breast-with-fresh-vegetables-selective-focus-210391630.jpg">
                </li>
                <li>
                    <img alt="" src="http://image.shutterstock.com/display_pic_with_logo/522076/266014253/stock-photo-fried-fish-fillet-atlantic-cod-with-rosemary-in-pan-266014253.jpg">
                </li>
                <li>
                    <img alt="" src="http://image.shutterstock.com/display_pic_with_logo/502972/264191042/stock-photo-bowl-of-healthy-fresh-fruit-salad-on-wooden-background-top-view-264191042.jpg">
                </li>
                <li>
                    <img alt="" src="http://image.shutterstock.com/display_pic_with_logo/356269/162416498/stock-photo-closeup-of-fried-rosemary-potato-wedges-in-a-rustic-setting-162416498.jpg">
                </li>
            </ul>
        </div>
    </body>

Application and controller code:

var app = angular.module('carouselApp',['angular-carousel']);

app.controller('carouselController', function($scope) {


});

I'm using angularjs 1.4.5 and angular-carousel 0.3.13, what am I doing wrong?

Upvotes: 3

Views: 554

Answers (1)

macrog
macrog

Reputation: 2105

it's something wrong with your styles, if you add an 'id' to :

<ul rn-carousel id="theCarousel">

and in you css:

#theCarousel{
    height:400px;
}

your carousel will work!

I will recommend you to use carousel from this page, never have any problem with it.

Upvotes: 2

Related Questions