- Posts: 1
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
|in the middle|
|middle|
Maybe at a time, must be done (but i didn't add the functionholch wrote: Is this described anywhere in the manual? I have never seen this before either!
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ // Identify this question var thisQuestion = $('#question{QID}'); // Calculate widths var tableWidth = $('table.subquestion-list:eq(0)', thisQuestion).width(); var sqWidth = $('.col-answers:eq(0)', thisQuestion).width(); var sqPercent = (sqWidth/tableWidth)*100; var answersCount = $('.col-responses col', thisQuestion).length; var answersWidth = (tableWidth-sqWidth)/answersCount; var answersPercent = (answersWidth/tableWidth)*100; // Move table elements and remove unnecessary elements $('col.separator:eq(0)', thisQuestion).parent().after($('col.col-answers:eq(0)', thisQuestion).parent()).remove(); $('thead tr.ls-heading.groups td.header_separator:eq(0)', thisQuestion).after($('thead tr.ls-heading.groups th:eq(0)', thisQuestion)).remove(); $('thead tr.ls-heading:last td.header_separator:eq(0)', thisQuestion).after($('thead tr.ls-heading:last td:eq(0)', thisQuestion)).remove(); $('tr.answers-list', thisQuestion).each(function(i) { $('.dual_scale_separator:eq(0)', this).after($('th.answertext', this)).remove(); }); // Assign new widths $('.col-answers', thisQuestion).css('width', sqPercent+'%'); $('.col-responses col', thisQuestion).css('width', answersPercent+'%'); }); </script>
Please : report issuetpartner wrote: It's completely broken in 3.x:
What unnecessary element ? remind we need to show it too with sub-question|middle|right on phone (reason of ls-label-xs-visibility) and need accessibility.- adding unnecessary HTML elements
Yes : right, except with 3 input for "subquestion" part width : i don't see how to set this.tpartner wrote: - not handling widths
<script>$(document).on('ready pjax:scriptcomplete',function(){ $("#question{QID} col.col-answers").width("0"); $("#question{QID} col.separator:not(.right_separator)").width("30%"); $("#question{QID} col.separator.right_separator").width("0"); }); </script>
The OP simply wanted the subquestion text in the middle. There was no mention of left/right text. I simply used your example for sub-questions using current vanilla theme, screen width ~1028px and you can see the results in my first screenshot.What unnecessary element ? remind we need to show it too with sub-question|middle|right on phone (reason of ls-label-xs-visibility) and need accessibility.
Yep, the 33% automatic width is to wide if there are middle and right … and this make a total width of 66% for all parts …tpartner wrote: The OP simply wanted the subquestion text in the middle. There was no mention of left/right text. I simply used your example for sub-questions using current vanilla theme, screen width ~1028px and you can see the results in my first screenshot.