Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Customize slider

  • Fran1991
  • Fran1991's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
4 days 11 hours ago #270802 by Fran1991
Customize slider was created by Fran1991
Please help us help you and fill where relevant:
Your LimeSurvey version:  Versión 5.6.42+231024
Own server or LimeSurvey hosting: 
Survey theme/template:
==================
(Write here your question/remark)

Hello everyone,

I have a question regarding the slider questions. Is there any way to modify the text? That is, when I insert the options, it only allows me to select from 1 to 5, but instead of displaying numbers, I'd like to customize it with some phrases. Is this possible?

Thank you all.

Please Log in to join the conversation.

More
4 days 9 hours ago #270804 by Mon2016
Replied by Mon2016 on topic Customize slider
I found this in the group in case it helps anyone.

Still working.

<script type="text/javascript" charset="utf-8">
 
  $(document).on('ready pjax:scriptcomplete',function(){
 
    // Identify this question
    var thisQuestion = $('#question{QID}');
 
    // Define the text strings
    var tipTexts = {
      1:  'Very good',
      2:  'Somewhat good',
      3:  'Neither good nor bad',
      4:  'Somewhat bad',
      5:  'Bad'
    };
 
    $('input:text', thisQuestion).on('slideEnabled',function(){ 
      var thisItem = $(this).closest('li');
 
      // Insert custom tooltip
      $('.tooltip-inner', thisItem).addClass('tooltip-inner-1 hidden');
      $('.tooltip', thisItem).append('<div class="tooltip-inner tooltip-inner-2">'+tipTexts[$(this).val()]+'</div>');
 
      // Listener on slider
      $(this).on('slide slideStop', function(event) {
        // Handle dynamic tooltip text
        $('.tooltip-inner-2', thisItem).text(tipTexts[$(this).val()]);
      });
    });
    });
</script>

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 days 9 hours ago #270805 by Joffm
Replied by Joffm on topic Customize slider
Hi,
there are some options.

Here a few examples from my tutorial

 


There are more in the forum. Search for "SliderTicks"

But what exactly do you want to achieve?
As usual: Send a lss export of this question, explain how it is to look like.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 days 9 hours ago #270806 by holch
Replied by holch on topic Customize slider
In my opinion a slider questions makes only really sense if there is some kind of "continuum".

If there are fixed stops on the slider, radio buttons are probably the better choice.

1: 'Very good',
2: 'Somewhat good',
3: 'Neither good nor bad',
4: 'Somewhat bad',
5: 'Bad'


Like this example. There is no good reason to use a slider question for something like this, if not for "I like how it looks".

From a research and a usability point of view, I think a list radio or a Matrix question is a lot better, because it is easier to answer/click and has less issues.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.

Please Log in to join the conversation.

More
4 days 9 hours ago #270807 by Mon2016
Replied by Mon2016 on topic Customize slider
Thanks, Joff, and Holch

Yes, it's precisely a "whim" for the "looks good" kind.

Since this is a survey aimed at a company's employees, the goal was to have good eyesight.

Here's my LSS in case it looks more dynamic.

When testing on mobile devices, the texts are cut off due to the screen size....

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose