Script arret carousel

This commit is contained in:
nyanloutre 2018-10-27 16:55:39 +02:00
parent f9232cc85e
commit 6847f6535a
1 changed files with 16 additions and 0 deletions

View File

@ -947,6 +947,22 @@
</div> </div>
</section> </section>
<script type="text/javascript">
$(document).ready(function(){
var windowHeight = window.innerHeight || document.documentElement.clientHeight
$('.carousel').carousel('pause');
$('.carousel').toArray().forEach(function(element) {
var rect = element.getBoundingClientRect();
if(rect.top <= windowHeight && rect.bottom >= 0) {
element.carousel('cycle');
} else {
element.carousel('pause');
}
});
});
</script>
<?php include('contact.html'); ?> <?php include('contact.html'); ?>
<?php include('footer.html'); ?> <?php include('footer.html'); ?>