Is it possible to use an Interactive Image using JavaScript | XM Community
Skip to main content
I am currently trying to determine if a research project I have coded independently to run on a specific server can be transformed to work in Qualtrics where I could have more control over the project. Below I have described what I would be attempting to do with some visual references. I apologize in advance for any confusion my description may provide. I have tried to be as clear as possible.



I am currently designing a research project that would allow participants to interact with an image by rotating the image on the horizontal axis. However, the actual mechanics of this process requires there to be two images, one overlaid on the other. Image A would be the rotatable object, however, this is actually one large panoramic image that has been parsed into specific segments. Image B is the "mask" image that covers everything except for one segment of Image A at a time. Participants would be able to "rotate" Image A by clicking or dragging a bar to move the window of Image B one segment left or right in Image A while staying centered on the screen (technically could be Image A moving while Image B is still). I have attached below an example of Image A and what the video of clicking and dragging to rotate the image looks like in our other setup. I believe that I have found a way to code this interaction in JavaScript using a process similar to the one found on this webpage: http://www.creativesgo.com/how_to_make_rotating_360_degree_photographs_photography_article_tips.html.



What I am currently wondering is: 1.) If I wrote this code in Javascript, would Qualtrics be able to handle this type of code?

2.) Would the images need to be uploaded into Qualtrics and the code would pull them from a specific question, or would the images need to be coded directly into the lines of code?

3.) Could you foresee mouse tracking being able to work in conjunction with code like this?



I am sorry I cannot share the code I have with you, as it is not written in JavaScript yet. I want to make sure Qualtrics would be able to handle this type of mechanic before choosing this language to write the code in.
> @jrothweiler said:

> 1.) If I wrote this code in Javascript, would Qualtrics be able to handle this type of code?

Yes

> 2.) Would the images need to be uploaded into Qualtrics and the code would pull them from a specific question, or would the images need to be coded directly into the lines of code?

You could upload the images to the Qualtrics library (although you could host them anywhere). The images would need to be coded into html question's html/CSS/JavaScript as needed.

> 3.) Could you foresee mouse tracking being able to work in conjunction with code like this?

Yes, but the JavasScript would need to capture it using a Qualtrics question or embedded data field.
I'd like to do something similar. I'd like my respondents to be able to enlarge or reduce an image by dragging a horizontal slider down or up. Any suggestions would be much appreciated.

Leave a Reply