角度旋转木马不起作用

时间:2015-09-10 07:33:51

标签: angularjs angular-carousel

我正在尝试使用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.5angular-carousel 0.3.13,我做错了什么?

1 个答案:

答案 0 :(得分:2)

如果你添加一个&#39; id&#39;你的风格有问题呢?致:

<ul rn-carousel id="theCarousel">

并在你的css:

#theCarousel{
    height:400px;
}

你的旋转木马会起作用!

我会建议你使用这个page的轮播,从来没有任何问题。