Remove extra spacing using Java | XM Community
Solved

Remove extra spacing using Java

  • 20 February 2018
  • 3 replies
  • 27 views

Userlevel 7
Badge +6
I am not very Java-savvy, but I know I can remove the extra space between questions by adding JavaScript to the question. I haven't done it for a while and cannot remember how.

The example I am working on is having "blank" question text for a couple of question types below a descriptive text box. I'd like only the answerable parts to be closer to the descriptive text, instead of huge blank spaces between them.
icon

Best answer by TomG 20 February 2018, 20:13

View original

3 replies

Userlevel 5
Badge +10
This was actually discussed in a previous thread with @AlexB providing the following code:

You can add this CSS into the Look & Feel (adjusting the last number in padding for the amount of space you want):

.Skin .QuestionText {
padding: 0 0 0px;
}
Userlevel 7
Badge +6
That is CSS that would apply to the whole theme. I know it has something to do with QID#. I will comb through the threads again, maybe I missed it.
Userlevel 7
Badge +27
You can put CSS inside a `<style>` tag as part of a question's text and it will only apply to that page.

Anyway, if you want to hide the Separators and the Question text for all but the first:
```
jQuery('.Separator').hide();
jQuery('.QuestionText').each(function(index) {
if(index > 0) jQuery(this).hide();
});
```

Leave a Reply