$(document).ready(function () {
var images = ["img/1.png", "img/2.png", "img/3.png"];
for (var i = 0; i < images.length; i++)
new Image().src = images[i];
var step, timerId;
$("#tap").click(function () {
step = 1;
timerId = setInterval(slideit, 20);
});
function slideit() {
if (step < 3){
document.images.slide.src = images[step - 1];
step++;
} else {
clearInterval(timerId);
}
}
});