Welcome to the LimeSurvey Community Forum

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

True visual analogue scales in Limesurvey?

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
13 years 2 weeks ago - 13 years 2 weeks ago #58174 by tpartner
Replied by tpartner on topic True visual analogue scales in Limesurvey?
Okay, now that I've woken up and re-read the thread, I think I understand - you're only concerned about clicking the slider bar, not dragging the handle.

Add the following to the end of template.css to convert the slider handle to a vertical bar and hide the slider callout (these styles are for the default template). Replace "QQ" with your question ID.
Code:
#questionQQ .ui-slider .ui-slider-handle {
  height:25px;
  width: 2px;
  margin-left: 0;
  top: -8px;
  background: #79B7E7 none;
  border: 0 none;
}
 
#questionQQ .slider_callout {
  display: none;
}

If you want to initially hide the slider handle, set up your survey to use JavaScript and add the following script to the source of the slider question. Again, replace "QQ" with the question ID.
Code:
<script type="text/javascript" charset="utf-8">
 
  $(document).ready(function() {
 
    var qID = QQ;
 
    $('#question'+qID+' .ui-slider .ui-slider-handle').hide();
    $('#question'+qID+' .ui-slider').live('mouseup', function() {
      $('#question'+qID+' .ui-slider .ui-slider-handle').show();
    });
 
  });
 
</script>


Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 13 years 2 weeks ago by tpartner.
The following user(s) said Thank You: joshendrikx, Tiepies, jesper_yde, r0bis
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
13 years 2 weeks ago - 13 years 2 weeks ago #58175 by DenisChenu
Replied by DenisChenu on topic True visual analogue scales in Limesurvey?
Maybe there are some other possibility:



It's just an idea :)

PS : again another possibility of jquery plugin with a option select : www.visualjquery.com/rating/rating_redux.html

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 13 years 2 weeks ago by DenisChenu.
The following user(s) said Thank You: joshendrikx
The topic has been locked.
  • joshendrikx
  • joshendrikx's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 1 week ago #58477 by joshendrikx
Replied by joshendrikx on topic True visual analogue scales in Limesurvey?
Thanks Tony, for your help. I really appriciate it! This looks like what I would need. I'll have to find some time to try it out, unfortuneatly my work is killing me at the moment...
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
13 years 1 week ago #58478 by Mazi
Maybe you can post a link to a demo survey once you are done!?

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
  • joshendrikx
  • joshendrikx's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 8 months ago #62932 by joshendrikx
Replied by joshendrikx on topic True visual analogue scales in Limesurvey?
Hi Shnoulle,

It's been a long time, sorry for that. I've been very busy with work. Just wanted to thank for your suggestion. I'm not skilled at jquery, so I used the other solution of changing the css file (for me this was difficult enough ;)
Thanks anyway for your help!
The topic has been locked.
  • joshendrikx
  • joshendrikx's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 8 months ago #62933 by joshendrikx
Replied by joshendrikx on topic True visual analogue scales in Limesurvey?
Hi Tony,

I finally had the time to take a look at your suggestions and with some trial and error (I'm totally new to any type of coding) it all work just as I wanted it to. So I really want to thank you again for your help!

Kind regards,

Jos
The topic has been locked.
More
12 years 6 months ago #65617 by mfino242
Replied by mfino242 on topic True visual analogue scales in Limesurvey?
Hi all,

I was trying to put textual anchors into my slider. I tried the suggestion presented earlier however it didn't work. It ended up looking like this

Low|High <
>

instead of

Low <
> High

Any help would be greatly appreciated.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
12 years 6 months ago #65619 by holch
Replied by holch on topic True visual analogue scales in Limesurvey?
What do you have in the space for "Slider left/right text separator"?

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
More
8 years 2 months ago #129816 by pio
tpartner, thank you for your answers.

clicking the slider bar works well...

However I have copied and pasted your java script code.

The slider handle is hidden, but it doesn't show up if I click on the slider..

any ideas?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 2 months ago #129832 by tpartner
Replied by tpartner on topic True visual analogue scales in Limesurvey?
Assuming you do not set an initial value for the sliders, inserting this into the question text will initially hide the handles of all un-moved sliders and then show the handles as the sliders are clicked. (there is no need to replace "{QID}", it will automatically pipe in the question ID)

Code:
<script type="text/javascript" charset="utf-8">    
  $(document).ready(function(){ 
 
    // Hide slider handles on un-moved sliders
    $('#question{QID} input.text').each(function(i){
      if($(this).val() == '') {
        $(this).closest('li.question-item').find('.ui-slider-handle').hide();
      }
    });
 
    // Click events on the sliders
    $('#question{QID} .ui-slider-1').on('click', function(e) {
      $(this).closest('li.question-item').find('.ui-slider-handle').show();
    });
    });
</script>

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: pio
The topic has been locked.
More
8 years 2 months ago #129835 by pio
wow, that's really cool, thanks a lot! I really appreciate your quick reply!

I'll need to dive into js a little bit
The topic has been locked.
More
8 years 1 month ago - 8 years 1 month ago #131581 by pio
Hello,

I've put an image at each side of the scale and would like the images to be aligned, so that the slider is in the middle (something like valign = "middle"). Any ideas how to accomplish this? (-> attachment)

edit: Would it be possible to do something like this with a scale from 0 to 10? (-> question2.jpg)

thanks,
Piotr
Last edit: 8 years 1 month ago by pio.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose