bootstrap实现Carousel旋转木马(焦点图)

引入bootstrap相关文件后,在html中写如下代码:

 1 <div class="col-lg-9" >
 2                     <!-- Carousel====================== -->
 3                     <div id="myCarousel" class="carousel slide" data-ride="carousel">
 4                         <!-- Indicators -->
 5                         <ol class="carousel-indicators">
 6                             <li data-target="#myCarousel" data-slide-to="0" class=""></li>
 7                             <li class="active" data-target="#myCarousel" data-slide-to="1"></li>
 8                             <li data-target="#myCarousel" data-slide-to="2"></li>
 9                         </ol>
10                         <div class="carousel-inner" role="listbox">
11                             <div class="item">
12                                 <img
13                                     src="http://gallery.myweb.com/547fcba0498e14c8d87c366e/547fd098498e14c8d87c369e.jpg"
14                                     alt="First slide">
15                                 <div class="container">
16                                     <div class="carousel-caption">
17                                     <%--     <h1>Example headline.</h1>
18                                         <p>
19                                             Note: If you're viewing this page via a
20                                             <code>file://</code>
21                                             URL, the "next" and "previous" Glyphicon buttons on the left
22                                             and right might not load/display properly due to web browser
23                                             security rules.
24                                         </p>
25                                         <p>
26                                             <a class="btn btn-lg btn-primary" href="#" role="button">Sign
27                                                 up today</a>
28                                         </p> --%>
29                                     </div>
30                                 </div>
31                             </div>
32                             <div class="item active">
33                                 <img
34                                     src="http://gallery.myweb.com/547fd2e3498e14c8d87c374f/547fd2ed498e14c8d87c3750.jpg"
35                                     alt="Second slide">
36                                 <div class="container">
37                                 <!--     <div class="carousel-caption">
38                                         <h1>Another example headline.</h1>
39                                         <p>Cras justo odio, dapibus ac facilisis in, egestas eget
40                                             quam. Donec id elit non mi porta gravida at eget metus.
41                                             Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
42                                         <p>
43                                             <a class="btn btn-lg btn-primary" href="#" role="button">Learn
44                                                 more</a>
45                                         </p>
46                                     </div> -->
47                                 </div>
48                             </div>
49                             <div class="item">
50                                 <img
51                                     src="http://gallery.myweb.com/547f32a4498e92e126340dfc/547f3839498e92e126340dfd.jpg"
52                                     alt="Third slide">
53                                 <div class="container">
54                                     <div class="carousel-caption">
55                                         <!-- <h1>希望h1> -->
56                                         <!-- <p>努力奔跑躲避追赶,而全力奔跑不是为了甩掉包袱,而是守护梦想!</p> -->
57                                         <!-- <p>
58                                             <a class="btn btn-lg btn-primary" href="#" role="button">围观</a>
59                                         </p> -->
60                                     </div>
61                                 </div>
62                             </div>
63                         </div>
64                         <a class="left carousel-control" href="#myCarousel" role="button"
65                             data-slide="prev"> <span
66                             class="glyphicon glyphicon-chevron-left"></span> <span
67                             class="sr-only">Previous</span>
68                         </a> <a class="right carousel-control" href="#myCarousel"
69                             role="button" data-slide="next"> <span
70                             class="glyphicon glyphicon-chevron-right"></span> <span
71                             class="sr-only">Next</span>
72                         </a>
73                     </div>
74                     <!-- /.carousel -->
75 
76                 </div>

 

 

转载于:https://www.cnblogs.com/yeqrblog/p/4699661.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值