ASKER
ASKER
ASKER
once the video is finished, the rest of the slideshow playsThis is not going to be natively supported - you are going to have write your own code to do this.
$(function() {
// SOME GLOBALS
var carouse = $('#carousel');
varcurrentvid = false;
// BIND TO THE SLIDE EVENT
$('#myCarousel').on('slide.bs.carousel', function (e) {
// IF A VIDEO IS PLAYING PAUSE IT
if (currentvid) currentvid.pause();
// CHECK IF SLIDE HAS A VIDEO
vid = $(e.relatedTarget).find('video');
if (vid.length) {
// GET A JAVASCRIPT REFERENCE TO <video>
currentvid = vid[0];
// STOP THE CAROUSEL
carousel.carousel('pause');
// RESET VIDEO TO START
// currentvid.load(); // optional if you want to start from beginning
// START VIDEO
currentvid.play()
}
else {
// REMOVE REFERENCE TO CURRENT VIDEO
currentvid = false;
// START AUTO CYCLE
carousel.carousel('cycle');
}
})
});
ASKER
ASKER
ASKER
ASKER
ASKER
ASKER
$('#myCarousel').on('slide.bs.carousel', function (e) {
Should be$('#home-slider').on('slide.bs.carousel', function (e) {
ASKER
varcurrentvid = false;
Should bevar currentvid = false;
No way for me to test - it was only meant to be an outline./
ASKER
var carousel = $('#carousel');
Should be
var carousel = $('#home-slider');
Also there is no code to check if the first slide has a video - so change the above then manually go to the last slide and let it transition to the first - then see if that works.ASKER
ASKER
ASKER
ASKER
JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.
TRUSTED BY
ASKER
user name: pepe
PW: BobTheBuilder45!!