1
I am developing a project in Laravel and I made a section where will show background images every 2 seconds.
My code js for you to have an idea.
const career = document.getElementById('career');
var index = 1;
function changeBackgroundImage(){
index += 1;
if(index < 4){
career.style.backgroundImage = `url('../../../images/pages/index/career/${index}.jpg')`;
}else{
index = 1;
career.style.backgroundImage = `url('../../../images/pages/index/career/${index}.jpg')`;
}
}
setInterval('changeBackgroundImage()', 2000)
I was wondering how do I javascript to count how many images there are inside this folder.
Thank you very much for your reply.
– GobsRuiz
I appreciate the feedback and I’m glad I could help.
– ℛɑƒæĿᴿᴹᴿ