Move horizontal position of labels in slider question | XM Community
Solved

Move horizontal position of labels in slider question

  • 19 February 2019
  • 4 replies
  • 128 views

I am using a slider with values from 0 to 100. I would like to place the labels "Mild" "Moderate" and "Severe" along the horizontal axis but I do not want them to be automatically put at 0, 50 and 100. I would actually like the "mild" to be at 10, "Moderate" at 35 and "Severe" at 75. Is there a way to do that with js? I can simply not code, so I am very appreciative for any help!
icon

Best answer by Anonymous 20 February 2019, 00:18

View original

4 replies

Hello @DrPRW ,

Assuming you have only three labels to the slider question.

Paste the below code in the js(OnReady) of slider question

var that=this.questionId;
var s=["center","left","left"];
for(var i=0;i<=2;i++){
jQuery("#"+that+" ul.labels li:eq("+i+")").css("text-align",s[i]);
if(i==1){
jQuery("#"+that+" ul.labels li:eq("+i+")").css("padding-left","75px");
}
}
Thank you for such a quick reply. Where can I go about learning to do this for myself? Is this javascript or css or a combination? Thanks again (and it worked perfectly!).
> @DrPRW said:
> Thank you for such a quick reply. Where can I go about learning to do this for myself? Is this javascript or css or a combination? Thanks again (and it worked perfectly!).

It's good to hear that you are interested in learning this, much appreciated. So, you can find the resource to learn here.
When I add a question under this one the descriptors are under the second question for some reason. I am actually asking the listeners to rate on two different scales for each audio file. One block will be one file with 2 questions. I have a screen shot of what is happening. I would like the "mild" "moderate" "severe" to be under the 1st question, not the second. Thank you!!

Leave a Reply