angularjs實(shí)現(xiàn)首頁(yè)輪播圖效果
更新時(shí)間:2017年04月14日 08:41:46 作者:№.1飛翔
這篇文章主要為大家詳細(xì)介紹了angularjs實(shí)現(xiàn)首頁(yè)輪播圖效果,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
本文實(shí)例為大家分享了angularjs輪播圖展示的具體代碼,供大家參考,具體內(nèi)容如下
<!DOCTYPE html>
<html ng-app="myApp" lang="en">
<head>
<meta charset="UTF-8">
<title>AngularJS carousel</title>
<link rel="stylesheet">
</head>
<body>
<div ng-controller="CarouselDemoCtrl">
<div style="height: 305px">
<carousel interval="myInterval" no-wrap="noWrapSlides">
<slide ng-repeat="slide in slides" active="slide.active">
<img ng-src="{{slide.image}}" style="margin:auto;">
<div class="carousel-caption">
<h4>Slide {{$index}}</h4>
<p>{{slide.text}}</p>
</div>
</slide>
</carousel>
</div>
</div>
<script src="../angular.js/1.3.13/angular.min.js"></script>
<script src="../angular.js/1.4.0-beta.4/angular-animate.min.js"></script>
<script src="../angular-ui-bootstrap/0.13.3/ui-bootstrap.min.js"></script>
<script src="../angular-ui-bootstrap/0.13.3/ui-bootstrap-tpls.min.js"></script>
<script>
angular.module('myApp', ['ui.bootstrap', 'ngAnimate']).controller('CarouselDemoCtrl', function ($scope) {
//輪播圖輪播間隔時(shí)間
$scope.myInterval = 2000;
$scope.noWrapSlides = false;
var slides = $scope.slides = [];
$scope.addSlide = function () {
var newWidth = 600 + slides.length + 1;
slides.push({
image: '',
text: 'Chocola & Vanilla',
});
slides.push({
image: '',
text: 'Chocola & Vanilla',
});
slides.push({
image: '',
text: 'Chocola & Vanilla',
});
slides.push({
image: '',
text: 'Chocola & Vanilla',
});
};
$scope.addSlide();
});
</script>
</body>
</html>
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
angularjs實(shí)現(xiàn)時(shí)間軸效果的示例代碼
本篇文章主要介紹了angularjs實(shí)現(xiàn)時(shí)間軸效果的示例代碼,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2017-11-11
Angular懶加載動(dòng)態(tài)創(chuàng)建顯示該模塊下聲明的組件
這篇文章主要為大家介紹了Angular懶加載動(dòng)態(tài)創(chuàng)建顯示該模塊下聲明的組件,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2022-05-05
Angular網(wǎng)絡(luò)請(qǐng)求的封裝方法
本篇文章主要介紹了Angular網(wǎng)絡(luò)請(qǐng)求的封裝方法,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2018-05-05
Angular(5.2->6.1)升級(jí)小結(jié)
今天小編就為大家分享一篇關(guān)于Angular(5.2->6.1)升級(jí)小結(jié),小編覺(jué)得內(nèi)容挺不錯(cuò)的,現(xiàn)在分享給大家,具有很好的參考價(jià)值,需要的朋友一起跟隨小編來(lái)看看吧2018-12-12
Angular2里獲?。╥nput file)上傳文件的內(nèi)容的方法
這篇文章主要介紹了Angular2里獲?。╥nput file)上傳文件的內(nèi)容的方法,非常具有實(shí)用價(jià)值,需要的朋友可以參考下2017-09-09

