Hi guys,
I followed a couple tutorials and still cannot get the setInterval to work. I basically want images to change each 1 second and I have to use the setInterval (class requirement). If I try to open this in the browser nothing comes up. I would really appreciate any help, thanks so much, here is the code:
<!DOCTYPE html>
<html>
<head>
<style>
image_data{
width: 1000px;
}
</style>
<title>Project1</title>
</head>
<body on load=set_time() >
<div id="image_data">
<img src="images/1.jpg id="data"></div>
/*
<script>
var start=1;
function set_time()
{
setInterval(image_show, 1000);
}
function image_show()
{
var image_data;
if(start==1)
{
image_data="1.jpg";
}
else if(start==2)
{ image_data="2.jpg";
}
else if(start==3)
{ image_data="3.jpg";
}
else {start=1;
}
document.getElementById("data").src=""+image_data;
start++;
}
</script>.
</body>
</html>