bootstrp carousel初体验 快速构建图片播放

这是一篇关于徐家汇公园长廊漫步的博客,包括梅花、桃花和人物笑容等精彩内容。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

img{
			border: 1px solid white;
			box-shadow: 2px 2px 12px #333;
			_width: expression(this.width > 600 ? "600px" : this.width + "px");
			_height: expression(this.width > 600 ? this.height * 600 / this.width + "px" : this.height + "px");
			_border: 1px solid gray;
		}
		.pointer{cursor: pointer;}

		#myCarousel img{width: 890px;}
		#myCarousel .carousel-caption{border: 1px solid white;border-top: transparent;}

 

<div id="myCarousel" class="carousel slide" ng-controller="CarouselCtrl">
		  <ol class="carousel-indicators">
			<li class="pointer{{ pic.class }}" data-target="#myCarousel" data-slide-to="{{ $index }}" ng-repeat="pic in pictures"></li>
		  </ol>
		  <!-- Carousel items -->
		  <div class="carousel-inner">
			<div class="item{{ pic.class }}" ng-repeat="pic in pictures">
				<img src="{{ pic.img }}" alt />
				<div class="carousel-caption">
				  <h4>{{ pic.title }}</h4>
				  <p>{{ pic.content }}</p>
				</div>
			</div>
		  </div>
		  <!-- Carousel nav -->
		  <a class="carousel-control left" href="#myCarousel" data-slide="prev">&lsaquo;</a>
		  <a class="carousel-control right" href="#myCarousel" data-slide="next">&rsaquo;</a>
		</div>

<script type="text/javascript" src="../../js/jquery-1.8.3.min.js"></script>
	<script type="text/javascript" src="../../js/bootstrap.min.js"></script>
	<script type="text/javascript" src="../../js/angular.min.js"></script>

 

$(function () {
		$('#myCarousel').carousel({
			interval: 5000
		});
		//setTimeout("$('#myCarousel').carousel('pause')", 2000);  // 暂停播放 // http://getbootstrap.com/2.3.2/javascript.html#carousel
	 });

	function CarouselCtrl($scope) {
		$scope.pictures = [];
		$scope.pictures.push({class: ' active', img: '51xxxxw1eh0rgce513j20xh0p0tqm.jpg', 
							  title: '徐家汇公园长廊漫步', content: '看那花枝招展的梅花,红艳艳的桃花,还有你的笑容'});
		$scope.pictures.push({class: '', img: '51baa38egxxxxzyu7oj20xh0p0qn4.jpg', 
							  title: '徐家汇公园长廊漫步2', content: '看那花枝招展的梅花,红艳艳的桃花,还有你的笑容'});
		$scope.pictures.push({class: '', img: '51baaxxxxgw1eh0rfw76dwj20xh0p0tog.jpg', 
							  title: '徐家汇公园长廊漫步2', content: '看那花枝招展的梅花,红艳艳的桃花,还有你的笑容'});
		$scope.pictures.push({class: '', img: '51bxxxxgw1eh0rf0simsj20xh0p0h9x.jpg', 
							  title: '徐家汇公园长廊漫步2', content: '看那花枝招展的梅花,红艳艳的桃花,还有你的笑容'});
		$scope.pictures.push({class: '', img: '51bxxxxw1eh0reydzcvj20xh0p0avz.jpg', 
							  title: '徐家汇公园长廊漫步2', content: '看那花枝招展的梅花,红艳艳的桃花,还有你的笑容'});
		$scope.pictures.push({class: '', img: '5xxxxgw1eh0rewdwpwj20xh0p0gri.jpg', 
							  title: '徐家汇公园长廊漫步2', content: '看那花枝招展的梅花,红艳艳的桃花,还有你的笑容'});
		$scope.pictures.push({class: '', img: '51baa3xxxxpditzozj21kw16hhdt.jpg', 
							  title: '徐家汇公园长廊漫步2', content: '看那花枝招展的梅花,红艳艳的桃花,还有你的笑容'});
	}

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值