Work with Timer on JS to change Background

Hello dear friends
I want to see my background webpage https://www.digikala.com/, for example, in the first seconds of the lane, in the photo 1, and in the second two, the lamb to the photo 2, but I do not know how to crawl it.
There are some of the code on the page:

<!doctype html>
<html>
<head>
<?php
$i='1';
?>
<script>

var timer;
function counter()
{
var c = document.getElementById("tf").value;
var i = parseInt(c);
i++;
document.getElementById("tf").value=i;
$i=parseInt(i);
//if(i==2)
// {
// $i='02';
//}
}

function start()
{
timer = setInterval("counter()",1000);
}
</script>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>
<body style="<?php echo('background-image: url(images/'.$i.'.jpg)'); ?>">
<input type="text" value="0" id="tf" readonly>
<?php
?>
<input type="button" value="Start" onClick="start();">
</body>
</html>

Do you have any idea? Please share with me.

Do you mean the image slider?

There are plenty of those free online to choose from. The page you link to seems to be using something called Swiper (check out the “Navigation” demo.

Hi Dear Pullo,
Yes I mean the image slider, Thanks for your help, I will check that.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.