Bootstrap实现轮播

Posted despatch

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Bootstrap实现轮播相关的知识,希望对你有一定的参考价值。

<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! -->
		<title>Bootstrap 101 Template</title>

		<!-- Bootstrap -->
		<link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
		<link rel="stylesheet" type="text/css" href="css/style.css" />
	</head>
	<body>


		<div id="boX">
			<!-- 导航栏 -->
			<div id="v1">
				<nav class="navbar navbar-inverse">
					<div class="container-fluid">
						<!-- Brand and toggle get grouped for better mobile display -->
						<div class="navbar-header">
							<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"
							 aria-expanded="false">
								<span class="sr-only">Toggle navigation</span>
								<span class="icon-bar"></span>
								<span class="icon-bar"></span>
								<span class="icon-bar"></span>
							</button>
							<a class="navbar-brand" href="#">学籍管理系统</a>
						</div>

						<!-- Collect the nav links, forms, and other content for toggling -->
						<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
							<ul class="nav navbar-nav">
								<li class="active"><a href="#">首页</a></li>
								<li class="dropdown">
									<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">功能
										<span class="caret"></span></a>
									<ul class="dropdown-menu">
										<li><a href="#">学籍查询</a></li>
										<li><a href="#">学籍修改</a></li>
										<li><a href="#">学籍更新</a></li>
										<li role="separator" class="divider"></li>
										<li><a href="#">建议</a></li>
										<li role="separator" class="divider"></li>
										<li><a href="#">资助</a></li>
									</ul>
								</li>
								<li class="active"><a href="#">帮助</a></li>
							</ul>
							<form class="navbar-form navbar-left">
								<div class="form-group">
									<input type="text" class="form-control" placeholder="用户名">
								</div>
								<div class="form-group">
									<input type="text" class="form-control" placeholder="密码">
								</div>
								<button type="submit" class="btn btn-default">Go</button>
							</form>
							<ul class="nav navbar-nav navbar-right">
								<li><a href="#">Link</a></li>
								<li class="dropdown">
									<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">学生管理
										<span class="caret"></span></a>
									<ul class="dropdown-menu">
										<li><a href="#">成绩查询</a></li>
										<li><a href="#">成绩比较</a></li>
										<li><a href="#">班级比较</a></li>
										<li role="separator" class="divider"></li>
										<li><a href="#">总体平均</a></li>
									</ul>
								</li>
							</ul>
						</div><!-- /.navbar-collapse -->
					</div><!-- /.container-fluid -->
				</nav>
			</div>
			<!-- 两边侧边栏 -->
			<div id="header3_02" style="background-color: gray;">
				<ul>
					<li><a href="#">二手优品</a></li>
					<li><a href="#">手机回收</a></li>
					<li><a href="#">手机维修</a></li>
					<li><a href="#">电脑维修</a></li>
					<li><a href="#">以旧换新</a></li>
					<li><a href="#">手机租用</a></li>
					<li><a href="#">二手优品</a></li>
					<li><a href="#">手机回收</a></li>
					<li><a href="#">手机维修</a></li>
					<li><a href="#">电脑维修</a></li>
					<li><a href="#">以旧换新</a></li>
					<li><a href="#">手机租用</a></li>
				</ul>
			</div>
			<div id="header3_03" style="background-color: gray;">
				<ul>
					<li><a href="#">二手优品</a></li>
					<li><a href="#">手机回收</a></li>
					<li><a href="#">手机维修</a></li>
					<li><a href="#">电脑维修</a></li>
					<li><a href="#">以旧换新</a></li>
					<li><a href="#">手机租用</a></li>
					<li><a href="#">二手优品</a></li>
					<li><a href="#">手机回收</a></li>
					<li><a href="#">手机维修</a></li>
					<li><a href="#">电脑维修</a></li>
					<li><a href="#">以旧换新</a></li>
					<li><a href="#">手机租用</a></li>
				</ul>
			</div>

			<!-- 轮播图 -->
			<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
				<!-- Indicators -->
				<ol class="carousel-indicators">
					<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
					<li data-target="#carousel-example-generic" data-slide-to="1"></li>
					<li data-target="#carousel-example-generic" data-slide-to="2"></li>
					<li data-target="#carousel-example-generic" data-slide-to="3"></li>
					<li data-target="#carousel-example-generic" data-slide-to="4"></li>
					<li data-target="#carousel-example-generic" data-slide-to="5"></li>
					<li data-target="#carousel-example-generic" data-slide-to="6"></li>
					<li data-target="#carousel-example-generic" data-slide-to="7"></li>
				</ol>

				<!-- Wrapper for slides -->
				<div class="carousel-inner" role="listbox">
					<div class="item active">
						<img src="img/1.jpg" alt="...">
						<div class="carousel-caption">
							...
						</div>
					</div>
					<div class="item">
						<img src="img/2.jpg" alt="...">
						<div class="carousel-caption">
							...
						</div>
					</div>
					<div class="item">
						<img src="img/3.jpg" alt="...">
						<div class="carousel-caption">
							...
						</div>
					</div>
					<div class="item">
						<img src="img/4.jpg" alt="...">
						<div class="carousel-caption">
							...
						</div>
					</div>
					<div class="item">
						<img src="img/5.jpg" alt="...">
						<div class="carousel-caption">
							...
						</div>
					</div>
					<div class="item">
						<img src="img/6.jpg" alt="...">
						<div class="carousel-caption">
							...
						</div>
					</div>
					<div class="item">
						<img src="img/7.jpg" alt="...">
						<div class="carousel-caption">
							...
						</div>
					</div>
					<div class="item">
						<img src="img/8.jpg" alt="...">
						<div class="carousel-caption">
							...
						</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>
		<!-- 底部页面 -->
		</div>
		<br><br><br><br>
		<div id="a">
		</div>
		<div id="b">
			<nav aria-label="Page navigation">
				<ul class="pagination">
					<li>
						<a href="#" aria-label="Previous">
							<span aria-hidden="true">«</span>
						</a>
					</li>
					<li><a href="#">1</a></li>
					<li><a href="#">2</a></li>
					<li><a href="#">3</a></li>
					<li><a href="#">4</a></li>
					<li><a href="#">5</a></li>
					<li>
						<a href="#" aria-label="Next">
							<span aria-hidden="true">»</span>
						</a>
					</li>
				</ul>
			</nav>
		</div>
		<!-- 底部footer -->
		<div id="footer">
		</div>
		<!-- jQuery (Bootstrap 的所有 javascript 插件都依赖 jQuery,所以必须放在前边) -->
		<script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
		<!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
		<script src="js/bootstrap.min.js"></script>
	</body>
</html>

  

真的是为后端人员提供了方便!!!

下面是这几张图片:

技术图片技术图片技术图片技术图片技术图片技术图片技术图片技术图片

 

 

 

以上是关于Bootstrap实现轮播的主要内容,如果未能解决你的问题,请参考以下文章

Bootstrap实现轮播

轮播图

我正在尝试将 Vue 数据实现到 Bootstrap 轮播中

如何用Bootstrap制作轮播图

AngularJS+ui.bootstrap实现图片轮播

移动端touch事件---利用bootstrap实现轮播图手指左右滑动事件