<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet"> <title>Hello World</title> <style> .carousel { height: 500px; } .carousel .item { height: 500px; } .carousel .item img { width: 100%; } .carousel-caption{ color:#0f0; } </style> </head> <body> <div id="carousel-id " class="carousel slide" data-ride="carousel"> <!-- Indicators --> <ol> <li data-target="#carousel-example-generic" data-slide-to="0"></li> <li data-target="#carousel-example-generic" data-slide-to="1"></li> <li data-target="#carousel-example-generic" data-slide-to="2"></li> </ol> <!-- Wrapper for slides --> <div role="listbox"> <div class="item active"> <img src=" http://img.mukewang.com/5412ad400001e52014280484.jpg" alt="..."> <div> 11 英寸 MacBook Air 充电一次可运行长达 9 小时,而 13 英寸机型则可运行长达 12 小时。 </div> </div> <div> <img src=" http://img.mukewang.com/5412ad7c0001d2eb10880541.jpg" alt="..."> <div> 无论是什么任务,配备 Intel HD Graphics 5000 图形处理器的第四代 Intel Core 处理器都能应对自如。 </div> </div> <div> <img src=" http://img.mukewang.com/5412ae5c0001653b12800644.jpg" alt="..."> <div> 有了新一代 802.11ac 技术,MacBook Air 令 Wi-Fi 速度超越极限。 </div> </div> </div> <!-- Controls --> <a class="left carousel-control" href="#carousel-id" role="button" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span> <span>Previous</span> </a> <a class="right carousel-control" href="#carousel-id" role="button" data-slide="next"> <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span> <span>Next</span> </a> </div> <!-- Bootstrap core JavaScript --> <!-- Placed at the end of the document so the pages load faster --> <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> <script> $(function(){ // 初始化轮播 $(".start-slide").click(function(){ $("#myCarousel").carousel('cycle'); }); }); </script> </body> </html>
醉了,你这个元素都诶有