簡體   English   中英

角度旋轉木馬不起作用

[英]angular-carousel doesn't work

我正試圖通過使用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) {


});
  • jsFiddle示例: https ://jsfiddle.net/anatoly314/n0qfj4dk/6/
  • plunker示例: http ://plnkr.co/edit/ERDtcVNdKSVTcqtH2XOT?p = info

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

你的風格有問題,如果你添加'id':

<ul rn-carousel id="theCarousel">

並在你css:

#theCarousel{
    height:400px;
}

你的旋轉木馬會工作!

我會建議你從這個頁面使用輪播,從來沒有任何問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM