Manipulating slider | XM Community
Skip to main content

Hello! For my study I am want to show participants 5 randomized scores on a simple graph where Y = score and X = participant. One way I thought to do this was to create a Slider with 5 questions (like the attached photo) and randomize the question order. However, I DON'T want participants to be able to click on the slider and change the score, and in my question preview, the slider bars are spaced so far apart that they don't fit on the screen.
Is there a way to make the slider unclickable, and to make the slider more compact, like the photo? (I want to do this at the question-level, I don't want all sliders in my survey to behave this way).
Screen Shot 2022-09-14 at 1.40.23 PM.png

Hi alex540150,
Add Javascript to your question and paste this in the onReady function:
var id = this.questionId;

//make unclickable
jQuery('.track').css("pointer-events", "none");

//change spacing by reducing the padding - change the pixel number to whatever you want

//bottom
jQuery("td.BarOuter").css("padding-bottom","30px");
//top
jQuery("div.statement").css("padding-bottom", "20px");     //statement text is 10px by default, so 30 - 10 = 20px
Adjust as necessary. I hope that helps!
EDIT: updated unclickable code to work properly


Thanks so much!!


Leave a Reply