How can I delay a question from appearing? | XM Community
Skip to main content
Solved

How can I delay a question from appearing?

  • November 11, 2017
  • 5 replies
  • 894 views

Goldie
Qualtrics Employee
Forum|alt.badge.img
Is there a way for me to delay a question from appearing? I have a video that I would like the respondent to watch for 30 seconds before a question appears right below it on the same page.

Best answer by AnthonyR

Add the following JavaScript to the question you would like a delayed: Qualtrics.SurveyEngine.addOnload(function() { this.getQuestionContainer().hide(); }); Qualtrics.SurveyEngine.addOnReady(function() { var delayTime = 30000 //This is the time of delay var that = this; setTimeout(function(){that.getQuestionContainer().show()}, delayTime); }); The timing can be updated by updating the value of delayTime, which is set in milliseconds.

5 replies

AnthonyR
Level 4 ●●●●
Forum|alt.badge.img+7
  • Level 4 ●●●●
  • Answer
  • November 14, 2017
Add the following JavaScript to the question you would like a delayed: Qualtrics.SurveyEngine.addOnload(function() { this.getQuestionContainer().hide(); }); Qualtrics.SurveyEngine.addOnReady(function() { var delayTime = 30000 //This is the time of delay var that = this; setTimeout(function(){that.getQuestionContainer().show()}, delayTime); }); The timing can be updated by updating the value of delayTime, which is set in milliseconds.

Goldie
Qualtrics Employee
Forum|alt.badge.img
  • Author
  • Qualtrics Employee
  • November 14, 2017
Perfect! Thank you!!

Forum|alt.badge.img+3
  • August 31, 2022

This is a great answer.
I've tried delaying a slider question. However, the problem is that when the slider appears (after 20 seconds) the slider is "cut". It looks as if the values had been reduced to 0-1, while the slider is set to be 0-100. The problem disappears when I remove the javascript code (above).
Is there a way to have the code "show" the entire slider (instead of cutting it)?
Thank you!
Two images to clarify:
With delay (in JS) what appears is:
image.pngWithout delay (in JS):
image.png


Tom_1842
Level 8 ●●●●●●●●
Forum|alt.badge.img+28
  • Level 8 ●●●●●●●●
  • November 3, 2022

Hi Marta , if you still need, I was able to get the slider to display okay after the delay by using the below:
var q="#"+this.questionId;
jQuery(q).css("content-visibility","hidden");
setTimeout(function () {
jQuery(q).css("content-visibility","visible");
},5000);


Forum|alt.badge.img+3
  • November 4, 2022

Thank you, Tom!