<!doctype html>"Utf-8"> <title> Mobile Carousel map </title> <meta content="Initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width"Name="Viewport"/> <meta content="initial-scale=1.0,user-scalable=no,maximum-scale=1"Media="(device-height:568px)"Name="Viewport"/> <!--Carousel Map JS---<script type="Text/javascript"Src="Http://files.cnblogs.com/xinlinux/iscroll.js"></script> <script src="Http://libs.baidu.com/jquery/1.9.0/jquery.js"></script> "Text/javascript">varMyscroll; function loaded () {Myscroll=NewIscroll ('wrapper', {snap:true, Momentum:false, HScrollbar:false, Onscrollend:function () {Document.queryselector ('#indicator > Li.active'). ClassName ="'; Document.queryselector ('#indicator > Li:nth-child ('+ ( This. Currpagex +1) +')'). ClassName ='Active'; } }); } document.addeventlistener ('domcontentloaded', Loaded,false);</script><!--Carousel Pattern--><style>body{margin:0px;} Header{text-Align:center; position:relative; Overflow:hidden;} ul{margin:0px; padding:0px;list-Style:none;} #nav {position:absolute; width: -%; height:20px; line-height:20px; bottom:0px;} #nav {float: Left; Margin-right:5%; Opacity1;} #nav ul li{float: Left; Background: #fff; border-radius:10px; width:10px; height:10px; margin-left:10px; margin-top:5px; Opacity0.5;} #nav ul li.active{background: #fff; opacity:1;} . Banner Img{width: -%;} . Banner UL li{float: Left;}</style><body> <divclass="Row-fluid"> class="Banner"> <div id="wrapper"style="Overflow:hidden;"> <div id="scroller"> <ul id="thelist"> <li> <a href="#">"images/1.jpg"/></a> </li> <li> &L T;a href="#">"images/2.jpg"/></a> </li> <li> <a href="#">"images/3.jpg"/></a> </li> </ul> </div> </d iv> </div> <div id="nav"> <div id="prev"onclick="javascript:myScroll.scrollToPage (' prev ', 0);"></div> <ul id="indicator"> <liclass="Active"></li> <li ></li> <li ></li> </ul> <div id="Next"onclick="javascript:myScroll.scrollToPage (' Next ', 0, 2);"></div> </div> <divclass="CLR"></div> varCount = document.getElementById ("thelist"). getElementsByTagName ("img"). length; for(i =0; I < count; i++) {document.getElementById ("thelist"). getElementsByTagName ("img"). Item (i). Style.csstext ="Width:"+ Document.body.clientWidth +"px"; } document.getElementById ("scroller"). Style.csstext ="Width:"+ document.body.clientWidth * Count +"px"; SetInterval (function () {Myscroll.scrolltopage ('Next',0, -, Count); }, 3500); Window.onresize=function () { for(i =0; I < count; i++) {document.getElementById ("thelist"). getElementsByTagName ("img"). Item (i). Style.csstext ="Width:"+ Document.body.clientWidth +"px"; } document.getElementById ("scroller"). Style.csstext ="Width:"+ document.body.clientWidth * Count +"px"; }; </script> </body>
App Carousel diagram