- Posts: 10
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { // Identify this question var thisQuestion = $('#question{QID}'); // Define the sub-heading text strings var subHeading1 = '<span style="color:black">Wie sehr stimmen Sie dem zu?</span>'; var subHeading2 = '<span style="indent:10pt;color:maroon">Wie wichtig ist Ihnen dass?</span>'; var subHeading3 = '<span style="color:maroon">Bietet Ihnen das Ihre derzeitige Arbeitsstelle?</span>'; var columnsLength = $('tr.answers-list:eq(0) > *', thisQuestion).length; // Insert the new rows $('tr.answers-list:eq(0)', thisQuestion).before('<tr class="sub-header-row"><th colspan="'+columnsLength+'">'+subHeading1+'</th></tr>'); $('tr.answers-list:eq(1)', thisQuestion).before('<tr class="sub-header-row"><th colspan="'+columnsLength+'">'+subHeading2+'</th></tr>'); $('tr.answers-list:eq(2)', thisQuestion).before('<tr class="sub-header-row"><th colspan="'+columnsLength+'">'+subHeading3+'</th></tr>'); // Fix up the row classes var rowClass = 1; $('table.subquestions-list tbody tr', thisQuestion).each(function(i) { if($(this).hasClass('sub-header-row')) { rowClass = 1 } else { rowClass++; $(this).removeClass('array1 array2') if(rowClass % 2 == 0) { $(this).addClass('array2'); } else { $(this).addClass('array1'); } } }); }); </script> <style type="text/css">.sub-header-row { margin-bottom: 20px; } .sub-header-row th { background-color: #efefef; color: #000000 !important; text-align: left; } </style>
.no-question { border-top:0; } .no-question .question-title-container { display:none; } .no-question .question-valid-container { display:none; } .no-bottom { border-bottom:0;margin-bottom:0; } .no-question .answer-container { padding-top: 0em; padding-bottom: 0.5em; } .no-bottom .answer-container { padding-bottom: 0em; }
Dann soll derjenige Dir auch sagen, wie es geht. Anscheinend kennt er ja eine Lösung.Ich habe die explizite Vorgabe, das Layout nicht zu verändern - müsste demnach also auch die Fragen auch untereinander haben.
var subHeading1 = '<span style="color:black">Wie sehr stimmen Sie dem zu?</span>'; var subHeading2 = '<span style="indent:10pt;color:maroon">Wie wichtig ist Ihnen dass?</span>'; var subHeading3 = '<span style="color:maroon">Bietet Ihnen das Ihre derzeitige Arbeitsstelle?</span>';