Star Slider: place question above the stars | XM Community
Skip to main content
Solved

Star Slider: place question above the stars


JoycaV
QPN Level 4 ●●●●
Forum|alt.badge.img+27
  • QPN Level 4 ●●●●
  • 236 replies
Hi, I'm looking for a way to ask long questions in combination with a star slider. Standard; the space for the text is very limited, so if you type a long question it appears on many lines. I found this: https://www.qualtrics.com/community/discussion/comment/3133#Comment_3133 that works great on desktop to combine long questions with the star slider; however on mobile it becomes completely unusable. So I thought, maybe a solution would be to make the question text appear above the stars, instead of next to them. Is there a way to do that? Thanks, Joyca

Best answer by TomG

Try: ``` Qualtrics.SurveyEngine.addOnload(function() { jQuery("#"+this.questionId+" tr").each(function() { var row = jQuery(this); var th = row.before("<tr></tr>").find("th").attr("colspan","4").css("text-align","left"); row.prev("tr").append(th); }); }); ```
View original

4 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5926 replies
  • Answer
  • March 5, 2020
Try: ``` Qualtrics.SurveyEngine.addOnload(function() { jQuery("#"+this.questionId+" tr").each(function() { var row = jQuery(this); var th = row.before("<tr></tr>").find("th").attr("colspan","4").css("text-align","left"); row.prev("tr").append(th); }); }); ```

JoycaV
QPN Level 4 ●●●●
Forum|alt.badge.img+27
  • Author
  • QPN Level 4 ●●●●
  • 236 replies
  • March 9, 2020
Thanks @TomG, it works 😀

Forum|alt.badge.img+1
  • 1 reply
  • October 28, 2024

Has anyone managed to do this and reduce the gap between the stars and the statements, currenltly mine has large gaps which when it’s on a website/app feedback means for a lot of scrolling!

 

 


Nam Nguyen
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+29
  • QPN Level 8 ●●●●●●●●
  • 1091 replies
  • October 28, 2024

@RyanBal Use this code, it will remove the additional padding

Qualtrics.SurveyEngine.addOnload(function() {
    jQuery("#" + this.questionId + " tr").each(function() {
        var row = jQuery(this);
        var th = row.before("<tr></tr>").find("th").attr("colspan", "4").css({
            "text-align": "left",
            "padding-bottom": "0px",
            "margin-bottom": "0px"
        });
        row.prev("tr").append(th);
    });

});

 


Leave a Reply