Use Javascript to Display Descriptive Text Only 2 Seconds | XM Community
Solved

Use Javascript to Display Descriptive Text Only 2 Seconds

  • 21 August 2019
  • 2 replies
  • 101 views

I am looking for Javascript code to have a descriptive text question disappear after two seconds. Respondents are briefly shown a message "We ask that you take a few moments to review this image before you will be able to continue" before then seeing an image.

I would like the message to disappear after 2 seconds at the same time as the image appears. I already know how to delay the image by 2 seconds using the Javascript code below.

Qualtrics.SurveyEngine.addOnReady(function()
{
var delayTime = 2000 //This is the time of delay
var that = this;
setTimeout(function(){that.getQuestionContainer().show()}, delayTime);

});

Any ideas on how to hide the text after two seconds? I couldn't find the solution among previously asked questions; any help would be greatly appreciated!
icon

Best answer by Bhushan 21 August 2019, 16:00

View original

2 replies

Badge +1
Hi @tioh1001 ,

You can use "Timing" question to hide the text after 2 seconds.

Thanks,
Bhushan
Userlevel 7
Badge +27
@tioh1001,

Do it the exact same way you show something after 2 seconds except use the .hide() function instead of the .show() function.

Leave a Reply