- Posts: 30
- Thank you received: 3
Ask the community, share ideas, and connect with other LimeSurvey users!
var thisQuestion = $('#question{QID}'); // Slide function $('.form-control', thisQuestion).on('slideStop', function( event ) { $(this).closest(".answer-item").find(".slider-handle").data("my-position",$(this).value()); });
Yeah, this type of information is always a little misleading. At the time the article is written it is true. And generally it works for this specific branch. But when a totally new branch of Limesurvey comes out, those workarounds generally don't work anymore, especially when there were changes to the template system, which has been the case twice since 2.05 (2.7 and 3.x). So I guess it is save to say that the workaround won't work for 3.15.1.the article recommended 2.05 or newer so thought it might be OK
$('.form-control', thisQuestion).on('slide slideStop', function...
I put only .on('slideStop', : it's don't work ?tpartner wrote: If you also also listen for the "slide" event, the handle is dynamic as it moves:
Code:$('.form-control', thisQuestion).on('slide slideStop', function...
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function() { var thisQuestion = $('#question{QID}'); // Slide function $('.form-control', thisQuestion).on('slide slideStop', function( event ) { console.log($(this).val()); }); }); </script>
OK, thanks .tpartner wrote: It works, but only when the handle stops moving.