- Posts: 17
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
<script type="text/javascript" data-author="Tony Partner"> $(document).ready(function() { // The number of questions to wrap in the flex container var numberQuestions = 3; // Identify the questions var thisQuestion = $('#question34824'); var rowQuestions = thisQuestion.add(thisQuestion.nextAll('.question-container:lt('+(numberQuestions-1)+')')); // Wrap the questions in a <div> element rowQuestions.wrapAll('<div class="question-flex-container" />'); }); </script>
<style type="text/css"> @media only screen and (min-width: 576px) { .question-flex-container { display: flex; justify-content: space-evenly; } } </style>
That will work for a fixed screen width but will not be responsive to varying screen widths where the question or answer text may wrap.Set the min-height of the answer-containers to the same value, that the heighest question just fits.
rowQuestions.wrapAll('<div class="question-flex-container" />');
yes... unfortunately also does not work...Did you try the sample survey I provided?
var thisQuestion = $('#question{QID}');