3

我正在尝试通过使用angular-carousel插件来实现轮播,但没有任何效果,只是空屏幕。

这是我的html代码:

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

应用程序和控制器代码:

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

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


});

我正在使用angularjs 1.4.5and angular-carousel 0.3.13,我做错了什么?

4

1 回答 1

2

如果您将“id”添加到以下位置,则您的样式有问题:

<ul rn-carousel id="theCarousel">

在你的CSS中:

#theCarousel{
    height:400px;
}

你的旋转木马会工作!

我会推荐你​​使用这个页面的轮播,从来没有任何问题。

于 2015-09-10T07:49:31.537 回答