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

Use Javascript to Display Descriptive Text Only 2 Seconds

  • August 21, 2019
  • 2 replies
  • 242 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!

Best answer by Bhushan

Hi @tioh1001 , You can use "Timing" question to hide the text after 2 seconds. Thanks, Bhushan

2 replies

Bhushan
QPN Level 2 ●●
Forum|alt.badge.img+1
  • QPN Level 2 ●●
  • Answer
  • August 21, 2019
Hi @tioh1001 , You can use "Timing" question to hide the text after 2 seconds. Thanks, Bhushan

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • August 22, 2019
@tioh1001, Do it the exact same way you show something after 2 seconds except use the .hide() function instead of the .show() function.