Labels and scale points in the mobile survey (smartphone version) | XM Community
Skip to main content
Solved

Labels and scale points in the mobile survey (smartphone version)


Hi experts!

I have this challenge, where I would like to view both Labels and scale points in the mobile survey (smartphone version) of a matrix question.
Attached is a screenshot with drawings of what I would like to have.
Thanks...
layut_adjustment.JPG

Best answer by TomG

A slicker solution is to leave your labels in place AND add the labels to the scale points inside a span with a class. For example:
1 - Strongly disagree
Add this css:
.mfLabel { display:none; }
.mobile .mfLabel { display:inline; }
It will look like this:
image.png

View original

11 replies

PraDeepKotian_XM
QPN Level 5 ●●●●●
Forum|alt.badge.img+21
  • QPN Level 5 ●●●●●
  • 228 replies
  • October 24, 2020

hi TadasN
You can insert the labels in scale points itself then it will show as you are looking for but both mobile and desktop version will be same.
image.png


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5937 replies
  • Answer
  • October 24, 2020

A slicker solution is to leave your labels in place AND add the labels to the scale points inside a span with a class. For example:
1 - Strongly disagree
Add this css:
.mfLabel { display:none; }
.mobile .mfLabel { display:inline; }
It will look like this:
image.png


  • Author
  • 3 replies
  • October 26, 2020

https://www.qualtrics.com/community/discussion/comment/31400#Comment_31400This is perfect Tom! Thank you so much.
I already use the 'reverse scale order' CSS, shown below.
How do I combine the two CSS codes into one? I just end up with CSS errors.

Qualtrics.SurveyEngine.addOnload(function() {
if(jQuery("#"+this.questionId+" .QuestionBody.mobile").length > 0) {
jQuery("#"+this.questionId+" tr.ChoiceRow").each(function() {
var label = jQuery(this).find("th");
jQuery(this).find("td").each(function(index) {
var choice = jQuery(this);
if(index > 0) {
label.after(choice);
if(choice.hasClass("last")) choice.removeClass("last");
}
else choice.addClass("last");
});
});
}
});


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5937 replies
  • October 26, 2020

https://www.qualtrics.com/community/discussion/comment/31415#Comment_31415The thing you posted is JavaScript, not CSS. I think the two are compatible - you can use them both together.


  • Author
  • 3 replies
  • October 27, 2020

Now I understand - and thanks, it worked like a charm. You are the boss!


Forum|alt.badge.img+2
  • 25 replies
  • July 18, 2022

Hey TomG ,
it works, thanks for that! But it looks a little bit weird when they have chosen one answer (see picture). Any possibility to fix it or do I have to live with it?

TadasN : Did it look the same in your case?
Output.PNG


Forum|alt.badge.img+2
  • 25 replies
  • July 18, 2022

TomG: I have change span class to div class. This seems to work. Do I need to be aware of any problems when I change it?


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5937 replies
  • July 20, 2022

https://community.qualtrics.com/XMcommunity/discussion/comment/47789#Comment_47789The only difference between a

and
is that a div is a block element and a span isn't. This can be overridden with display:inline and display:block, respectively.


hilaryk
Level 1 ●
Forum|alt.badge.img+6
  • Level 1 ●
  • 11 replies
  • August 3, 2023

Hi there, I am trying to implement this on my survey but it’s not working. I considered starting a new thread, but since it’s pretty much exactly the same issue I thought I’d reply here.

I must be making a mistake somewhere but can’t see it. Here is my scale point, with an added span class for the label: 

And here is my custom CSS:

But looking at the mobile preview, I only see the scale point numbers and not the text:

Can anyone spot my error? Thank you so much for any insight!


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5937 replies
  • August 3, 2023

It looks like you are using Simple layout, which has a different html structure.  Try replacing .mobile with .matrix-accordion.

BTW, tr.ChoiceRow formatting doesn’t apply to Simple layout either.


hilaryk
Level 1 ●
Forum|alt.badge.img+6
  • Level 1 ●
  • 11 replies
  • August 3, 2023

@TomG Thank you so much, this worked! I was really losing my mind trying to figure out the issue! The row formatting was a leftover from when I was using another layout, so I will remove that. Thanks again!


Leave a Reply