lundi 27 avril 2015

switch checked check-box with time interval in javascript

I'm a total noob at javascript and currently having issues with a project.

I'm trying to make a picture slide with specific transitions. The slide builds on and tags for the transition (check-boxes). I tried making a script that changes the checked box after every 5s.

I already got a good chunk of help from a friend but I can't get it to work at all.

This is the script:

   var slider_i = 1; function slider_change(){if(++slider_i > 4){slider_i=1;} document.getElementById('select-img-'+slider_i).checked = true; setTimeout(slider_change, 50000);} slider_change();

Here is the slider I'm talking about: http://ift.tt/1DCP10A




Aucun commentaire:

Enregistrer un commentaire