In an online experiment, we need to display images for 500ms, so we can't rely on pure HTML only (due to slow or instable internet connections). On the other hand, using jspsych would be too much overhead for such a simple task. So how can we hide an image and show it once it's loaded for a certain duration? Would be great if the answer includes information where to precisely put the code in Qualtrics javascript section (addOnload, addOnready, …).
BTW: in the rendered HTML of an image there's the data-attribute data-image-state="ready". What is it for?
Solved
Preloading an image and then displaying it for a very short duration
Best answer by CamM
Hi novern, credit goes to TomG for his original solution which I've adapted to meet your specific ask.
Basically, you can add the following code to the question's addOnReady function -:
var img = jQuery("#"+this.questionId+" img");
setTimeout(function() { img.hide(); },500);
Hope that helps.
Cheers,
Cameron
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.