AngularJS 实现轮播图效果实现步骤如下:要实现这个功能,可以http://angular-ui.github.io/bootstrap/ 中的控件实现。实现步骤如下:1. 下载ui-bootstrap.js程序http://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.11.0.min.js 目前版本是0.11.02. 在HTML中引入script<script type="text/javascript" src="path/to/angular.min.js"></script><script src="path/to/ui-bootstrap.min.js"></script><script src="path/to/ui-bootstrap-tpls.min.js"></script>3. HTML示例代码如下: <!-- 轮播图 --><div><carousel interval="myInterval"><slide ng-repeat="slide in slides" active="slide.active"><img ng-src="{{slide.image}}" style="margin:auto;"><div class="carousel-caption"><p>{{slide.text}}</p></div></slide></carousel></div> 4. PostListController.js代码如下: 1 ftitAppModule.controller("PostListController",2 function ($scope) { 3 // 设置轮播图图片间隔 4 $scope.myInterval = 5000; 5 // 轮播图数据初始化 6 var slides = $scope.slides = []; 7 // 添加轮播图源 8 slides.push({ image: "/Content/images/carousel_1.png", text: "亲爱的你,情人节快乐" }); 9 slides.push({ image: "/Content/images/carousel_1.png", text: "亲爱的你,情人节快乐" });10 }); 最终效果:AngularJS权威教程 清晰PDF版 http://www.linuxidc.com/Linux/2015-01/111429.htm希望你喜欢,并分享我的工作~
带你走近AngularJS系列:
- 带你走近AngularJS - 基本功能介绍 http://www.linuxidc.com/Linux/2014-05/102140.htm
- 带你走近AngularJS - 体验指令实例 http://www.linuxidc.com/Linux/2014-05/102141.htm
- 带你走近AngularJS - 创建自定义指令 http://www.linuxidc.com/Linux/2014-05/102142.htm
如何在 AngularJS 中对控制器进行单元测试 http://www.linuxidc.com/Linux/2013-12/94166.htm在 AngularJS 应用中通过 JSON 文件来设置状态 http://www.linuxidc.com/Linux/2014-07/104083.htmAngularJS 之 Factory vs Service vs Provider http://www.linuxidc.com/Linux/2014-05/101475.htmAngularJS —— 使用 ngResource、RESTful APIs 和 Spring MVC 框架提交数据 http://www.linuxidc.com/Linux/2014-07/104402.htm
AngularJS 的详细介绍:请点这里
AngularJS 的下载地址:请点这里
本文永久更新链接地址:http://www.linuxidc.com/Linux/2015-01/112320.htm