Posts

Showing posts with the label website

JavaScript Image Slider with ClickOn Effects and Click Tracking

JavaScript Image Slider with ClickOn Effects and Click Tracking Excuse my n00b question of JS about images and click-ons: I am planning on using this to step through an image array for an image slider, based on this question/answer: //Array of images var Images = ['https://dummyimage.com/100x100/000/fff.jpg', 'https://dummyimage.com/200x200/000/fff.jpg', 'https://dummyimage.com/300x300/000/fff.jpg' ]; //Step counter var step = 1; function gallery() { //change image document.getElementById('Imgs').src = Images[step]; //Or you can use - document.images.slide.src=Images[step]; // is step more than the image array? if (step < Images.length - 1) { // No - add 1 for next image. step++; } else { // Yes - Start from the first image step = 0; } } //When the ready, set interval. window.onload = setInterval(gallery, 2500); But I need to also ask viewers to (1) click on the particular images and record their choices (which image ...