Files
Andreas Wilms 78481ca337 init
python
2025-09-09 19:40:44 +02:00

40 lines
1.1 KiB
JavaScript

// ******
// Please define your load animation in the configuration variable.
// Note that each page needs to have a (hidden) button called #end-trial that will
// be used to close the trial and move on to the user rating task
// ******
//$('#b1').on('click', function() {
// $('#launch').addClass('display_toggle');
//
// if (jsPsych.data.getURLVariable('debug') === 'true') {
// $('.debug').css({'display': 'block'});
// }
//});
var reloads = 0;
document.getElementById("end-trial").style.display = "none"
document.getElementById("timer").innerHTML = picDuration;
var distance = picDuration - 1;
var x = setInterval(function() {
// Time calculations for days, hours, minutes and seconds
var seconds = distance;
distance--;
// If the count down is finished, write some text
if (seconds <= 0) {
document.getElementById("timer").innerHTML = "";
document.getElementById("end-trial").style.display = ""
clearInterval(x);
} else {
// Display the result in the element with id="demo"
document.getElementById("timer").innerHTML = seconds;
}
}, 1000);