Slider for a trade-off between two options | XM Community
Question

Slider for a trade-off between two options

  • 24 June 2020
  • 3 replies
  • 175 views

Badge +1

Hi everyone,
I would like to use a slider to allow subjects to make a trade-off between two options. Specifically, I want to let them assign a probability to both options which will add up to 100% (e.g. 70% of getting option X and 30% chance of getting option Y). Something along the lines of the screenshot below.
I have seen solutions to getting labels at both ends of the slider. But I am struggling with how to remove the values above the slider and showing the probabilities of the two options (below the slider or somewhere else) while the subjects are moving the slider bar.
Slider.PNGI have some basic understanding of JS, but I find it hard to find a starting point. If anyone can point me into the right direction that would be greatly appreciated!


3 replies

Userlevel 7
Badge +27

The best solution is to use a MutationObserver to update the percentages when the slider handle changes position.

Badge +1

https://community.qualtrics.com/XMcommunity/discussion/10850/slider-for-a-trade-off-between-two-optionsHi Sarts,
Have you solved this question? I have a similar question. Would you please share your code with me?

Userlevel 7
Badge +27

https://community.qualtrics.com/XMcommunity/discussion/comment/49433#Comment_49433If you are interested, I have a function, dualSidedSlider, that does this.

Leave a Reply