I am working on an experiment about distractions. As part of the experiment, I need a question that appears on the screen for two seconds, disappears for two seconds, and then reappears. Here is my snapshot when programming this in javascript.
Qualtrics.SurveyEngine.addOnload(function()
{
function togglequestion() {
if(this.getQuestionDisplayed()) {
this.questionContainer.style.display = 'none';
} else {
this.questionContainer.style.display = 'block';
}
};
var a1 = setTimeout(togglequestion, 2000);
var a2 = setTimeout(togglequestion, 4000);
});
I think the problem is how I declare my function or if statement. I am not very good at javascript, so any help would be greatly appreciated!
source
share