我计划基于此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);
但是我还需要请观众(1)单击特定图像并记录他们的选择(他们单击了哪个图像,最好是何时单击?)结果数据可能可以通过Amazon Mechanical Turk“ ExternalSubmit”存储。 '或我对其他可行的方法持开放态度; (2)也许只是在单击图像时添加黑框,以便他们确定已经记录了该图像?
我无所适从,不胜感激一些指示,想法和代码,可以帮助我入门。非常感谢!