!DOCTYPE htmlhtmlheadtitleTry v1.2 Bootstrap Online/titlelink href=/bootstrap/css/bootstrap.min.css rel=stylesheet
编程学习网为您整理以下代码实例,主要实现:Bootstrap实用方法,希望可以帮到各位朋友。
<!DOCTYPE HTML>
<HTML>
<head>
<Title>Try v1.2 bootstrap Online</Title>
<link href="/bootstrap/CSS/bootstrap.min.CSS" rel="stylesheet">
<script src="/scripts/jquery.min.Js"></script>
<script src="/bootstrap/Js/bootstrap.min.Js"></script>
</head>
<body>
<div ID = "myCarousel" class = "carousel slIDe">
<!-- Carousel indicators -->
<ol class = "carousel-indicators">
<li data-target = "#myCarousel" data-slIDe-to = "0" class = "active"></li>
<li data-target = "#myCarousel" data-slIDe-to = "1"></li>
<li data-target = "#myCarousel" data-slIDe-to = "2"></li>
</ol>
<!-- Carousel items -->
<div class = "carousel-inner">
<div class = "item active">
<img src = "/bootstrap/images/slIDe1.png" alt = "First slIDe">
</div>
<div class = "item">
<img src = "/bootstrap/images/slIDe2.png" alt = "Second slIDe">
</div>
<div class = "item">
<img src = "/bootstrap/images/slIDe3.png" alt = "Third slIDe">
</div>
</div>
<!-- Carousel nav -->
<a class = "carousel-control left" href = "#myCarousel" data-slIDe = "prev">‹</a>
<a class = "carousel-control right" href = "#myCarousel" data-slIDe = "next">›</a>
<!-- Controls buttons -->
<div style = "text-align:center;">
<input type = "button" class = "btn prev-slIDe" value = "PrevIoUs SlIDe">
<input type = "button" class = "btn next-slIDe" value = "Next SlIDe">
<input type = "button" class = "btn slIDe-one" value = "SlIDe 1">
<input type = "button" class = "btn slIDe-two" value = "SlIDe 2">
<input type = "button" class = "btn slIDe-three" value = "SlIDe 3">
</div>
</div>
<script>
$(function() {
// Cycles to the prevIoUs item
$(".prev-slIDe").click(function() {
$("#myCarousel").carousel('prev');
});
// Cycles to the next item
$(".next-slIDe").click(function() {
$("#myCarousel").carousel('next');
});
// Cycles the carousel to a particular frame
$(".slIDe-one").click(function() {
$("#myCarousel").carousel(0);
});
$(".slIDe-two").click(function() {
$("#myCarousel").carousel(1);
});
$(".slIDe-three").click(function() {
$("#myCarousel").carousel(2);
});
});
</script>
</body>
</HTML>
沃梦达教程
本文标题为:Bootstrap实用方法
基础教程推荐
猜你喜欢
- Bootstrap .helper类 1970-01-01
- Bootstrap创建下拉菜单 1970-01-01
- Bootstrap .pagination-sm类 1970-01-01
- D3.js selectAll()用法 2022-07-13
- Bootstrap垂直堆栈选项卡 1970-01-01
- Bootstrap clearfix类 1970-01-01
- CSS加载社交按钮 1970-01-01
- CSS结合样式 1970-01-01
- Bootstrap向表中添加更密集的信息 1970-01-01
- Bootstrap table-hover类 1970-01-01