to see if you can throw me a cable. I'm doing a web page and I want to make images go by every x time. What I have right now is:
JAVASCRIPT:
miBanner = document.getElementById("canvas");
ctx = miBanner.getContext("2d");
var i=0;
var imagenes = ["./img/banner1.jpeg","./img/banner2.jpg","./img/banner3.png"];
img = new Image ();
function dibujar(){
img.src = imagenes[0];
ctx.drawImage(img, 0, 0, 900, 260);
if(i<2){
i++;
}
else{
i=0;}
}//dibujar()
setInterval(dibujar,300);
HTML:
<script type="text/javascript" src="js/javascript.js"></script>
But the static image remains. Let's see if you can tell me the fault. Thank you very much!