Is there any way to move the numbers below the slider? | XM Community
Solved

Is there any way to move the numbers below the slider?

  • 11 May 2021
  • 1 reply
  • 73 views

Userlevel 1

Hi, my slider question has 4 grid line points defined with numbers from 1 to 5 . I wanted to know if there is any code which allows me to move these numbers so that they appear below the slider bar?

icon

Best answer by Tom_1842 5 October 2022, 15:52

View original

1 reply

Userlevel 7
Badge +27

Hi there, if you still need, I was able to put this in place by adding the below to the question's JavaScript in the OnReady section.
To add numbers beneath each slider statement, try using the below:
jQuery("#"+this.questionId+" > div.Inner.BorderColor.HSLIDER > div > fieldset > div > div > div.labels-container").insertAfter("#"+this.questionId+" table.sliderGrid.Slider");

To add numbers beneath just the last slider on the page, try using the below:
const last = Array.from(
  document.getElementsByClassName('slider-container')
).pop();

jQuery("#"+this.questionId+" > div.Inner.BorderColor.HSLIDER > div > fieldset > div > div > div.labels-container").insertAfter(last);
SliderNumbersBelow.png

Leave a Reply