To modify the slider handle shape (multiple numerical input question type)

More
5 months 1 week ago #168480 by Albinux
Albinux created the topic: To modify the slider handle shape (multiple numerical input question type)
Hi everyone,

First of all, I would like to thank all the active members of this forum for their valuable work.

My LimeSurvey version is 2.72.6+171207.

In the question type "multiple numerical input", it is possible to use a continuum with a cursor/slider. By default, this slider can take three different shapes: a circle, a square or a triangle. There is also an option "custom". When I check this option, I get a little man-shaped slider instead of the three other shapes mentioned above.

What I would like is to have a short vertical line as a slider.


Do you know what I have to do to get such a slider ?

Thank you very much in advance.

Please Log in or Create an account to join the conversation.

More
5 months 6 days ago - 5 months 6 days ago #168529 by Joffm
Joffm replied the topic: To modify the slider handle shape (multiple numerical input question type)
My idea,
use the "square" and
1. minimize the width.
2. adapt the position of tooltip

So put this at the end of your "template,css"
.slider-handle {
    height:28px;
    width:2px;
/* Change the color if desired
    background-color: #C18D00;
    background-image: -webkit-linear-gradient(top, #C18D00 0%, #C18D00 100%);
    background-image: -o-linear-gradient(top, #C18D00 0%, #C18D00 100%);
    background-image: linear-gradient(to bottom, #C18D00 0%, #C18D00 100%);
*/    
}
.slider .tooltip.tooltip-main {
    margin-left:-20px !important;
  }



To hide the tooltip add:
.slider .tooltip.top {
    display: none !important;
}
.slider .tooltip-main .top {
        display: none !important;
}

Best regards
Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Attachments:
Last Edit: 5 months 6 days ago by Joffm.
The following user(s) said Thank You: Albinux

Please Log in or Create an account to join the conversation.

More
5 months 6 days ago #168530 by Albinux
Albinux replied the topic: To modify the slider handle shape (multiple numerical input question type)
Hello Joffm,

Your idea fits perfectly, thank you very much!

However, two small problems are emerging:

1) The slider is not centered vertically with the horizontal continuum (it is slightly too low).
I solved the problem by adding top: -0.30em; to the portion of code you suggested:
.slider-handle {
    height:28px;
    width:4px;
    top: -0.30em;
/* Change the color if desired
    background-color: #C18D00;
    background-image: -webkit-linear-gradient(top, #C18D00 0%, #C18D00 100%);
    background-image: -o-linear-gradient(top, #C18D00 0%, #C18D00 100%);
    background-image: linear-gradient(to bottom, #C18D00 0%, #C18D00 100%);
*/    
}

2) The initial position of the slider is slightly shifted to the left from the start of the horizontal continuum. The slider is therefore outside the horizontal continuum. Furthermore, it is not possible to move the slider to the right end of the continuum. The slider stops slightly to the left of this end.
Concerning this problem, I did not find the code to add to fix it.
Do you still have a good idea in stock? :)

Please Log in or Create an account to join the conversation.

More
5 months 6 days ago #168532 by Joffm
Joffm replied the topic: To modify the slider handle shape (multiple numerical input question type)
Hi, albinux,
you have to adapt the css, of course.
Use a webdeveloper tool which is included in your webbrowser and examine and change the values.

But there are two more options.

1. The very easy way:
Use the "custom" option. Here you enter the code of the fontawesome icon. http://astronautweb.co/snippet/font-awesome/
Only the four characters "f...".



2. The more sophisticated way:
Use this script. You have to create your own png.
https://www.limesurvey.org/forum/design-issues/113075-how-to-personnalize-sliders-design#161148



Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Attachments:
The following user(s) said Thank You: tpartner, Albinux

Please Log in or Create an account to join the conversation.

More
5 months 5 days ago #168555 by Albinux
Albinux replied the topic: To modify the slider handle shape (multiple numerical input question type)

you have to adapt the css, of course.
Use a webdeveloper tool which is included in your webbrowser and examine and change the values.


This is the way I chose. This way led me to add to the template.css file the following line of code: margin-left: -0.10em !important;. More specifically, I included it in the code portion cited in my previous message:
.slider-handle {
    height: 28px;
    width: 4px;
    top: -0.30em;
    margin-left: -0.10em !important;
}

And it works perfectly! :)

Thank you again Joffm !

Best regards

Albinux

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!