0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-11-29 11:24:18 +01:00
Bootstrap/js/tests/visual/carousel.html

73 lines
3.0 KiB
HTML
Raw Normal View History

<!doctype html>
2017-10-22 14:02:24 +02:00
<html lang="en">
2016-11-12 16:12:58 +01:00
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
2016-11-12 16:12:58 +01:00
<link rel="stylesheet" href="../../../dist/css/bootstrap.min.css">
<title>Carousel</title>
<style>
.carousel-item {
transition: transform 2s ease, opacity .5s ease;
}
</style>
2016-11-12 16:12:58 +01:00
</head>
<body>
<div class="container">
<h1>Carousel <small>Bootstrap Visual Test</small></h1>
<p>The transition duration should be around 2s. Also, the carousel shouldn't slide when its window/tab is hidden. Check the console log.</p>
2016-11-12 16:12:58 +01:00
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<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>
</ol>
<div class="carousel-inner">
2016-11-12 16:12:58 +01:00
<div class="carousel-item active">
<img src="https://i.imgur.com/iEZgY7Y.jpg" alt="First slide">
2016-11-12 16:12:58 +01:00
</div>
<div class="carousel-item">
<img src="https://i.imgur.com/eNWn1Xs.jpg" alt="Second slide">
2016-11-12 16:12:58 +01:00
</div>
<div class="carousel-item">
<img src="https://i.imgur.com/Nm7xoti.jpg" alt="Third slide">
2016-11-12 16:12:58 +01:00
</div>
</div>
2016-12-30 11:29:47 +01:00
<a class="carousel-control-prev" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
2016-11-12 16:12:58 +01:00
<span class="sr-only">Previous</span>
</a>
2016-12-30 11:29:47 +01:00
<a class="carousel-control-next" href="#carousel-example-generic" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
2016-11-12 16:12:58 +01:00
<span class="sr-only">Next</span>
</a>
</div>
</div>
2018-07-25 11:29:16 +02:00
<script src="../../dist/util.js"></script>
<script src="../../dist/dom/polyfill.js"></script>
<script src="../../dist/dom/manipulator.js"></script>
2017-08-21 09:11:37 +02:00
<script src="../../dist/dom/eventHandler.js"></script>
2017-08-24 22:22:02 +02:00
<script src="../../dist/dom/selectorEngine.js"></script>
<script src="../../dist/dom/data.js"></script>
2016-11-12 16:12:58 +01:00
<script src="../../dist/util.js"></script>
<script src="../../dist/carousel.js"></script>
<script>
var t0
var t1
var carousel = document.getElementById('carousel-example-generic')
// Test to show that the carousel doesn't slide when the current tab isn't visible
// Test to show that transition-duration can be changed with css
carousel.addEventListener('slid.bs.carousel', function (event) {
t1 = performance.now()
console.log('transition-duration took ' + (t1 - t0) + 'ms, slid at ', event.timeStamp)
})
carousel.addEventListener('slide.bs.carousel', function () {
t0 = performance.now()
2016-11-12 16:12:58 +01:00
})
</script>
</body>
</html>