Willkommen im Online-Support von SoSci Survey.

Hier bekommen Sie schnelle und fundierte Antworten von anderen Projektleitern und direkt von SoSci Survey.

→ Eine Frage stellen


Welcome to the SoSci Survey online support.

Simply ask a question to quickly get answers from other professionals, and directly from SoSci Survey.

→ Ask a Question

0 votes

Hello,

Is there any way to disable a slider without changing the transparency of the image? I would like to present some sliders with a fixed value that the participant can't change. I have tried to do so by specifying the current value and disabling the slider with JavaScript:

<script type="text/javascript">
   SoSciTools.attachEvent(window, "load", function() {
   var slider = SoSciSliders.getSlider("SB02_01");
   slider.value = 80;
   slider.disabled = true;
    });
</script>

This works well. However, the image of the slider appears more transparent. Is there any way to retain the transparency/colors of the original image in a disabled slider?

Any help with this issue will be very much appreciated - Thanks in advance!
Best,

Irene

in SoSci Survey (English) by s059953 (130 points)

1 Answer

+1 vote
 
Best answer

Well, the disabledfeature is intended to actually signal that the slider won't work.

But there's a rather simple workaround: Set the minimum and maximum position of the slider to the same value. Then respondents won't be able to move the slider, although it's technically not disabled... Does'nt work for multiple slider items in a question with different values, of course.

Well ... not convinced? I am not, either. So, we modified the disabled feature a bit. It now accepts a value for the opacity:

<script type="text/javascript">
   SoSciTools.attachEvent(window, "load", function() {
   var slider = SoSciSliders.getSlider("SB02_01");
   slider.value = 80;
   slider.disabled = 1.0;
    });
</script>
by SoSci Survey (53k points)
selected by s059953
That works great!  
Many thanks for the quick answer :)

Best,
Irene
...