Welcome to the LimeSurvey Community Forum

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

Dynamisch Werte von Slidereingabe in Frage nutzen

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 days 2 hours ago - 3 days 8 hours ago #265533 by Joffm
Hallo,
das kann passieren, wenn man - wie Du - die Fragen am Anfang nicht beantwortet

Also, mit welcher Version arbeitest Du?

Ich schicke dann eine passende lss

Joffm 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 3 days 8 hours ago by Joffm.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 days 8 hours ago #265553 by Joffm
Ach, Du hattest ja geschrieben, dass bei Euch die Version nicht erkennbar ist.

Na gut, hier das kleine script
Code:
<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>

Joffm
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • Felina
  • Felina's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 days 7 hours ago #265555 by Felina
Danke, ich werde es mal ausprobieren.
Ich habe mal per Mail nachgefragt, hoffentlich bekomme ich da eine Antwort welche Version von der Uni genutzt wird. Sonst habe ich nur gesehen das in der ISS Datei von mir <DBVersion>365</DBVersion> steht.

Leider scheint der Code bei mir nicht zu funktionieren, habe ich den so richtig angepasst?
Code:
<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>

 

File Attachment:

File Name: limesurvey...3114.lss
File Size:17 KB
(Diesmal hoffentlich alles richtig, Frage alleine in einer Umfrage)

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 days 6 hours ago #265556 by Joffm
Hallo,
was funktioniert nicht?
Dies ist so eine Aussage wie "Das Auto fährt nicht."
Wird gar kein Bild angezeigt?
Wird nur das eine bzw. die anderen angezeigt?
Oder?

Mir sind drei Dinge aufgefallen.
1. Die Maße der beiden Bilder sind unterschiedlich  (200x300 vs. 300x200)
2. Die Bildertypen sind unterschiedlich (bubble_0.png vs. bubble_1.jpg)
3. Wenn das erste Bild "bubble_0" heißt, wird es jetzt bei Sliderstellung "0" zweimal nebeneinander angezeigt.

Wenn ich dies korrigiere, ist alles in Ordnung

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: Felina

Please Log in to join the conversation.

  • Felina
  • Felina's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 days 6 hours ago #265557 by Felina
Es war die Dateiendung, danke. Hatte ich nicht gemerkt das die bei Ihrem Beispiel anders war. Angepasst auf png und es funktioniert.

Vielen Dank für die Hilfe.

Please Log in to join the conversation.

Moderators: Joffm

Lime-years ahead

Online-surveys for every purse and purpose