How can I delay a question from appearing? | XM Community
Skip to main content
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.
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.
Perfect! Thank you!!

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


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);


Thank you, Tom!


Leave a Reply