I have a script that loads content using load() via a click function.
I'd like to change this to auto load content every one minute like a slideshow.
I have 3 videos I need to loop through.
Please can someone point me in the right direction I have no idea where to start. My current script is below.
Thanks
I have updated the code below, in accordance with elliot-bonneville answer. I still need to find a way to loop through these videos.
JS
// define var video
var video = $('div.video');
var linkOne = $('.video_1').attr('href');
var linkTwo = $('.video_2').attr('href');
var linkThree = $('.video_3').attr('href');
setInterval(function() {
// load content into video
video.load( linkTwo + ' .content' , function() {
// remove loading text
$('.load').remove();
});
}, 10000) // 60000 milliseconds = one minute
setInterval(function() {
// load content into video
video.load( linkThree + ' .content' , function() {
// remove loading text
$('.load').remove();
});
}, 10000) // 60000 milliseconds = one minute
setInterval(function() {
// load content into video
video.load( linkOne + ' .content' , function() {
// remove loading text
$('.load').remove();
});
}, 10000) // 60000 milliseconds = one minute