init
python
This commit is contained in:
39
PCSurvey/PCstatic/js/pik.js
Normal file
39
PCSurvey/PCstatic/js/pik.js
Normal file
@@ -0,0 +1,39 @@
|
||||
// ******
|
||||
// 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);
|
||||
|
||||
Reference in New Issue
Block a user