javascript - Open all accordion table cells on page load -
currently first table cell open on page load, i'd have them open.
jquery(document).ready(function($) { $("#accordion").accordion(); $('#accordion .ui-accordion-content').show(); updatetheaccordion(); $(document).on('click', "#filter-timetable", function() { $(".timetable-input").attr('disabled', 'disabled'); var url = timetable['url']; var teacherid = $("#teacher-data").val(); var data = { 'action': 'get_teacher_timetable', "teacherid": teacherid, 'from': $("#timetable-datefrom").val(), 'to': $("#timetable-dateto").val(), 'template': $('input[name=template-type]').val() }; jquery.ajax({ url: url, type: 'post', data: data, success: function(data) { $(".timetable-input").removeattr('disabled'); jquery("#teacher-timetable").html(data); updatetheaccordion(); } }); }); var dateformat = "mm/dd/yy", = $("#timetable-datefrom").datepicker().on("change", function() { to.datepicker("option", "mindate", getdate(this)); }), = $("#timetable-dateto").datepicker().on("change", function() { from.datepicker("option", "maxdate", getdate(this)); }); $("#timetable-datefrom").datepicker("setdate", "now") $("#timetable-dateto").datepicker("setdate", "+1w") function getdate(element) { var date; try { date = $.datepicker.parsedate(dateformat, element.value); } catch (error) { date = null; } return date; } }); function updatetheaccordion() { jquery("#accordion").accordion(); } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div id="accordion"> <h3></h3> <div> <table class="tg"> <tr> <th class="tg-yw4l">php</th> <th class="tg-yw4l">php</th> <th class="tg-baqh">php</th> <th class="tg-baqh">php</th> <th class="tg-baqh">php</th> </tr> <tr> <td class="tg-6k2t">php</td> <td class="tg-6k2t">php</td> <td class="tg-j0tj">php</td> <td class="tg-j0tj">php<strong> </strong>" php</td> <td class="tg-j0tj"> php </td> </tr> </table> </div>
Comments
Post a Comment