How (with Javascript or CSS) can I remove non-integer values from a slider? | XM Community
Skip to main content
I would like to have reference lines for half-values when a participant answers a question as shown below. The goal would be to not have the non-integer values present, such that only values visible would be 0-10. I have found how to remove all the values from being visible, how to remove the leading value, but not how to iterate through to remove specific (in this case, non-integer) values.



Any suggestions are appreciated.



!



For a bonus question, does anyone see a way to put the Labels in-line with the slider-bar? This would result in "Not at all" being located in the "Text Here" location, and "Completely" would be to the right of the slider-bar... mirror image with the "Text Here"?
Assuming you have mobile friendly checked:

```

Qualtrics.SurveyEngine.addOnload(function() {

jQuery("#"+this.questionId+" ul.numbers li:odd").hide();

});

```

Creating a bipolar slider is more complicated and the method would depend on if mobile-friendly is checked or not.
Tom, thanks much for the reply. For those that are interested, I also managed to kluge this together: (my apologies, I can't get the code quote to block this out for some reason)



Qualtrics.SurveyEngine.addOnload(function() {

var qid = this.questionId;

var ticks = $(qid).select('span.TickContainer');

for(var i=ticks.length - 2; i>0; i--) { /* start at next to last tick */

var labels = ticks[i].select('span');

i--; /* skip every other tick */

for(var j=0; j<labels.length; j++) {

var label = labels[j].innerHTML.trim();

labels[j].innerHTML = "";

}

}

labels[0].innerHTML = "0"; /*need to add back the last one */

});

Leave a Reply