- Posts: 8
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Prinzipiell: Ja.Ist es möglich den Value eines Sliders als Variable in Javascript zu benutzen?
Welche Datei?Ich hoffe das ist die richtige Datei?
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
<img alt="" src="https://www.mysurvey.de/userfiles/Boot001_klein.jpg" style="width: 300px; height: 200px;" /> <img alt="" id="pic" src="" style="width: 300px; height: 200px;" /> <script type="text/javascript"> $(document).on('ready pjax:scriptcomplete',function(){ // Identify elements var thisQuestion = $('#question{QID}'); var sliderInput = $('.answer-item.slider-item:eq(0) input:text'); $(sliderInput).on('slideEnabled',function(){ // Listener on slider $(this).on('slide slideStop', function(event) { var x=$(this).val(); //Dies ist nur für das Beispiel nötig; wegen der Namen der Bilder if(x<10) { x='0' + x; } $('#pic').attr('src', 'https://www.mysurvey.de/userfiles/Hamburg-Ballett_'+x+'.jpg'); }); }); }); </script>
Please Log in to join the conversation.
<img alt="" src="/umfragen/limesurvey/upload/surveys/773114/images/bubble_0.png" style="width: 200px; height: 300px;" /><img alt="" id="pic" src="" style="width: 300px; height: 200px;" /> <script type="text/javascript"> $(document).on('ready pjax:scriptcomplete',function(){ // Identify elements var thisQuestion = $('#question{QID}'); var sliderInput = $('.answer-item.slider-item:eq(0) input:text'); $(sliderInput).on('slideEnabled',function(){ // Listener on slider $(this).on('slide slideStop', function(event) { var x=$(this).val(); $('#pic').attr('src', '/umfragen/limesurvey/upload/surveys/773114/images/bubble_'+x+'.jpg'); }); }); }); </script>