- Posts: 9
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ // Identify this question var thisQuestion = $('#question{QID}'); // Define the new labels var labels = { 1: 'Is much less important than', 2: 'Is less important than', 3: 'Is as important as', 4: 'Is more important than', 5: 'Is much more important than' }; // Initial slider state $('.question-item', thisQuestion).each(function(i) { var thisRow = $(this); $('input[type="text"]', thisRow).on('slideEnabled', function(event, ui) { $('.tooltip-inner', thisRow).addClass('hidden'); $('.tooltip', thisRow).append('<div class="tooltip-inner inserted">'+labels[$('input[type="text"]', thisRow).val()]+'</div>'); $('.tooltip', thisRow).css('margin-left', '-'+($('.tooltip', thisRow).width()/2)+'px'); }); }); // Listener on sliders $('input[type="text"]', thisQuestion).on('slide slideStop', function(event, ui) { var thisRow = $(this).closest('.question-item'); $('.tooltip-inner.inserted', thisRow).text(labels[$('input[type="text"]', thisRow).val()]); $('.tooltip', thisRow).css('margin-left', '-'+($('.tooltip', thisRow).width()/2)+'px'); checkconditions($(this).val(), $(this).attr('name'), 'text'); }); }); </script>
Nope - too much work/maintenance so I just put the larger ones in the LS workarounds section . When time allows, I will convert this one to a jQuery plugin to make it a little more user-friendly and add it to the workarounds.Did you ever think of publishing them in a searchable way, like in a Wiki/website of just LS solutions?