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

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

  • May 11, 2021
  • 1 reply
  • 138 views

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?

Best answer by Tom_1842

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

1 reply

Tom_1842
Level 8 ●●●●●●●●
Forum|alt.badge.img+28
  • Level 8 ●●●●●●●●
  • Answer
  • October 5, 2022

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