Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohann-S <johann.servoire@gmail.com>2015-09-27 02:30:11 +0300
committerChris Rebert <code@chrisrebert.com>2015-10-12 01:10:49 +0300
commit817d997b75d970cc22000f345f68092ed3f0525b (patch)
tree662f82d45a1989aaf3e02d5270550692a87d12cf /js/tests/visual/carousel.html
parent9b12e5f495535aa64bcf77703c51b17742ec7f06 (diff)
Use Page Visibility API in Carousel; fixes #17706
Avoids cycling carousels when the page isn't visible. Closes #17710 Refs #15566
Diffstat (limited to 'js/tests/visual/carousel.html')
-rw-r--r--js/tests/visual/carousel.html10
1 files changed, 9 insertions, 1 deletions
diff --git a/js/tests/visual/carousel.html b/js/tests/visual/carousel.html
index 47dacaa6a0..e6bfeedab0 100644
--- a/js/tests/visual/carousel.html
+++ b/js/tests/visual/carousel.html
@@ -21,7 +21,7 @@
<div class="page-header">
<h1>Carousel <small>Bootstrap Visual Test</small></h1>
</div>
-
+ <p>Also, the carousel shouldn't slide when its window/tab is hidden. Check the console log.</p>
<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>
@@ -53,6 +53,14 @@
<script src="../vendor/jquery.min.js"></script>
<script src="../../dist/util.js"></script>
<script src="../../dist/carousel.js"></script>
+<script>
+ $(function () {
+ // Test to show that the carousel doesn't slide when the current tab isn't visible
+ $('#carousel-example-generic').on('slid.bs.carousel', function (event) {
+ console.log('slid at ', event.timeStamp);
+ })
+ });
+</script>
</body>
</html>