Write a script to slide show the images by using settimeout() and cleartimeout() methods.
Answers
Answered by
0
var pause = 3000; //interval, in milliseconds, between transitions var i = 0; //image counter //last index in 'imgs' array var imgCt = imgs.length - 1; var pic = document.getElementById("pic"); //the <img> element in the HTML file var timer; //rotate between the images in the "imgs" array function rotate() { pic.src = imgs[i]; if (i === (imgs.length -1)) { i = 0; } else { i++; } timer = setTimeout("rotate()", pause); } window.onload = rotate; //transitions either forward or backward function chgSlide(direction) { clearTimeout(timer) i += direction; if (i > imgCt) { i = 0; } if (i < 0) { i = imgCt; } pic.src = imgs[i];
}
This is the Java script codes
}
This is the Java script codes
Answered by
0
Explanation:
Sorry.........i dont know the answer.....plz follow me
Similar questions
CBSE BOARD XII,
8 months ago
Math,
8 months ago
Political Science,
1 year ago
Physics,
1 year ago
CBSE BOARD X,
1 year ago
Social Sciences,
1 year ago