Load gif from beginning and after everything else? | XM Community
Skip to main content
Hi,



I want to make sure that gifs in my question load from the beginning of the gif file and after everything else on the page. In other words, I want to ensure that the user sees the gif in its entirety.



What would be a good solution for this?



Thank you,

S
Hi @Syntheso,

add first gif question and ask respondent what they can see. if they select correct answer for your gif than it is assure that they can see gif.
Hi Jesi,



Thank you for your response but that doesn't solve my problem.



The gif is a test item so I want to ensure that they see it from the beginning.



At the moment sometimes the gif loads in the middle of the animation or sometimes at the last frame and it also loads after everything else. I want to combat this somehow to ensure that everything else loads, then the gif starts_ from the beginning_.
This seems like a good solution but I don't know how to implement it in Qualtrics:



https://stackoverflow.com/questions/24145424/how-to-make-gif-always-to-start-from-beginning-in-jquery-mobile
> @syntheso said:

> This seems like a good solution but I don't know how to implement it in Qualtrics:

>

> https://stackoverflow.com/questions/24145424/how-to-make-gif-always-to-start-from-beginning-in-jquery-mobile



Add the code in the above link in the Rich content editor --> HTML view of the question
Why not in the Javascript input form?
> @syntheso said:

> Why not in the Javascript input form?



Yes, you can put that in the js of the question but in onLoad and replace #correctGIF with .QuestionText
Could you please provide me with the full code? I don't have the understanding of how to put it all together.
> @syntheso said:

> Could you please provide me with the full code? I don't have the understanding of how to put it all together.



Paste the following code in the js(onReady) of the question



jQuery('.QuestionText img').attr("src",""); // remove it

jQuery('.QuestionText ').append('<img src="YOUR_GIF_URL">');
Thank you. However, this results in two images in my post.



I require the image to be used as part of the question so I can draw hotspots on top of it.



Very best,

Seb
Hello @syntheso



Paste the following code in the js(onLoad) of the question



jQuery(".HotSpotImage").attr("src","");



AND Paste the following code in the js(onReady) of the question

` jQuery(".HotSpotImage").attr("src","YOUR_GIF_URL");`

Leave a Reply