- Posts: 73
- Thank you received: 1
Ask the community, share ideas, and connect with other LimeSurvey users!
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ var thisQuestion = $('#question{QID}'); //Insert new style rules var newStyle = '<style type="text/css">\ .inserted-spacer-row {\ border-top: 5px solid #FFFFFF;\ border-bottom: 5px solid #FFFFFF;\ background-color: #2C3E50;\ }\ .inserted-spacer-row td {\ padding: 10px !important;\ }\ @media only screen and (max-width: 801px) {\ .inserted-spacer-row {\ margin-bottom: 20px;\ padding: 0 !important;\ border: 1px solid #2C3E50 !important;\ border-radius: 4px;\ }\ }\ </style>'; $("head link[rel='stylesheet']").last().after(newStyle); // Define a spacer row var numCells = $('tr.radio-list:eq(0) > *', thisQuestion).length; var insertedRow = '<tr class="inserted-spacer-row">\ <td colspan="'+numCells+'"></td>\ </tr>'; // Insert a spacer row $(insertedRow).insertBefore('tr.radio-list:eq(2)', thisQuestion); }); </script>
<script charset="utf-8" type="text/javascript"> $(document).ready(function(){ var thisQuestion = $('#question{QID}'); //Insert new style rules var newStyle = '<style type="text/css">\ .inserted-spacer-row {\ border-top: 1px solid #FFFFFF;\ border-bottom: 1px solid #FFFFFF;\ background-color: #2C3E50;\ }\ .inserted-spacer-row td {\ padding: 3px !important;\ }\ @media only screen and (max-width: 801px) {\ .inserted-spacer-row {\ margin-bottom: 3px;\ padding: 0 !important;\ border: 1px solid #2C3E50 !important;\ border-radius: 4px;\ }\ }\ </style>'; $("head link[rel='stylesheet']").last().after(newStyle); // Define a spacer row var numCells = $('tr.radio-list:eq(0) > *', thisQuestion).length; var insertedRow = '<tr class="inserted-spacer-row">\ <td colspan="'+numCells+'"></td>\ </tr>'; // Insert a spacer row $('tr.radio-list:eq(5)', thisQuestion). before(insertedRow); }); </script>