Labels under the slider bar (two slider bars with different labels) | XM Community
Skip to main content
In the survey I am preparing some of the blocks have two slider bar questions with different labels. I need the labels of both slider bars to be displayed below the track bar. When I use javascript to achieve this, the result is that labels are indeed displayed beneath the slider bars but by duplicate. As in the image:



!



I am using a javascript code I found in another thread. I am inserting it in the "Onload" function of only one of the questions. If I insert the code in both questions the result is now four sets of labels under the track of the slider bars. This is the code i am using:



jQuery(" ul.labels").insertAfter("div.slider-container");





By the way, using jQuery("#"+this.questionId+" ul.labels").insertAfter("div.slider-container"); in one or both questions does not solve the problem. When added to only one question it makes the labels of all questions to be displayed under the track bars but leaves a set of labels over the second questions as in the image:



!
You are intermixing the elements from the two questions. Try it like this:

```

jQuery("#"+this.questionId+" ul.labels").insertAfter("#"+this.questionId+" div.slider-container");

```
Thank you TomG. It works great! That was exactly the problem. I put the corrected code in both questions so the labels of the two questions moved under the track of the slider bar.



!

Leave a Reply