Javascript loading to slow | XM Community
Solved

Javascript loading to slow

  • 24 February 2018
  • 1 reply
  • 39 views

Hey!

I am using javascript to randomize some pictures as part of a multiple choice question. I am not able to use the advanced randomization included in Qualtrics as there are some very specific rules the randomization needs to adhere to.

I figured out the javascript part. The only problem is that when the page loads, the question briefly flashed the non-randomized order of pictures before showing the correct randomized version. Is there any way to load the javascript earlier, or to delay the showing of the question so that this flash doesn't happen?
icon

Best answer by TomG 24 February 2018, 00:15

View original

1 reply

Userlevel 7
Badge +27
You can eliminate the flash by putting your question text in a `<div>` with a lot a top padding, then change the top padding to zero at the end of your JavaScript. That way when the images initially flash they are off the screen:
`<div id="myqt" style="padding-top:3000px">Question text goes here</div>`

At end of JavaScript:
`jQuery("#myqt").css("padding-top","0px");`

Leave a Reply