1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-19 20:02:34 +02:00

Rewrite carousel without jquery

This commit is contained in:
Johann-S
2017-08-24 22:22:02 +02:00
committed by XhmikosR
parent c5595e5b67
commit 44f38e4128
7 changed files with 353 additions and 207 deletions

View File

@@ -47,18 +47,22 @@
<script src="../../../node_modules/jquery/dist/jquery.slim.min.js"></script>
<script src="../../dist/dom/eventHandler.js"></script>
<script src="../../dist/dom/selectorEngine.js"></script>
<script src="../../dist/dom/data.js"></script>
<script src="../../dist/util.js"></script>
<script src="../../dist/carousel.js"></script>
<script>
$(function() {
var t0, t1;
var carousel = SelectorEngine.find('#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-example-generic').on('slid.bs.carousel', function(event) {
EventHandler.on(carousel, 'slid.bs.carousel', function (event) {
t1 = performance.now()
console.log('transition-duration took' + (t1 - t0) + 'ms, slid at ', event.timeStamp)
}).on('slide.bs.carousel', function() {
})
EventHandler.on(carousel, 'slide.bs.carousel', function () {
t0 = performance.now()
})
})