Forráskód Böngészése

阿里百秀bootstrap轮播图

Cathy 4 éve
szülő
commit
8785d44606

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 2 - 0
alibaixiu-bootstrap/bootstrap/js/jquery.min.js


+ 11 - 1
alibaixiu-bootstrap/css/index.css

@@ -95,7 +95,7 @@ a:hover {
   height: 128px;
   margin-bottom: 10px;
 }
-.news li a{
+.news li>a{
   position: relative;
   display: block;
   width: 100%;
@@ -109,11 +109,16 @@ a:hover {
   width: 50%;
   height: 266px;
 }
+.carousel, .carousel img {
+  width: 100%;
+  height: 266px !important;
+}
 .news li:nth-child(1) a p{
   font-size: 16px;
   line-height: 41px;
   padding: 0 10px;
 }
+.carousel-caption,
 .news li a p {
   position: absolute;
   bottom: 0;
@@ -126,6 +131,11 @@ a:hover {
   padding: 8px 10px;
   margin-bottom: 0;
 }
+.carousel-caption {
+  line-height: 41px;
+  font-size: 16px;
+  padding: 0
+}
 .publish {
   border-top: 1px solid #ccc;
 }

+ 39 - 5
alibaixiu-bootstrap/index.html

@@ -10,7 +10,8 @@
     <![endif]-->
     <!-- 引入bootstrap样式文件 -->
     <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
-
+    <script src="bootstrap/js/jquery.min.js"></script>
+    <script src="bootstrap/js/bootstrap.min.js"></script>
     <link rel="stylesheet" href="css/index.css">
 </head>
 <body>
@@ -40,10 +41,43 @@
         <div class="news clearfix">
           <ul>
             <li>
-              <a href="#">
-                <img src="upload/lg.png" alt="">
-                <p>阿里百秀</p>
-              </a>
+              <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
+                <!-- Wrapper for slides 轮播图片 -->
+                <div class="carousel-inner" role="listbox">
+                    <div class="item active">
+                        <img src="upload/banner.dpg" alt="...">
+                        <div class="carousel-caption">
+                          <p>阿里百秀1</p>
+                        </div>
+                    </div>
+                    <div class="item">
+                        <img src="upload/banner1.dpg" alt="...">
+                        <div class="carousel-caption">
+                          <p>阿里百秀2</p>
+                        </div>
+                    </div>
+                    <div class="item">
+                        <img src="upload/banner2.dpg" alt="...">
+                        <div class="carousel-caption">
+                            <p>阿里百秀3</p>
+                        </div>
+                    </div>
+                </div>
+                <!-- Controls 左右箭头 -->
+                <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
+                    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
+                    <span class="sr-only">Previous</span>
+                </a>
+                <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
+                    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
+                    <span class="sr-only">Next</span>
+                </a>
+              </div>
+              <script>
+                 $('.carousel').carousel({
+                      interval: 2000
+                  })
+              </script>
             </li>
             <li>
               <a href="#">

BIN
alibaixiu-bootstrap/upload/banner.dpg


BIN
alibaixiu-bootstrap/upload/banner1.dpg


BIN
alibaixiu-bootstrap/upload/banner2.dpg


BIN
alibaixiu-bootstrap/upload/banner3.dpg