问题
the following code is a piece of the code generated by fullcalendrar jquery plugin ver 2. It has changed a bit since ver 1.x in the classes it uses.
<div class="fc-slats">
<table>
<tbody>
<tr>
<td class="fc-axis fc-time fc-widget-content" style="width: 37px;"><span>07:00</span></td>
<td class="fc-widget-content"></td>
</tr>
<tr class="fc-minor">
<td class="fc-axis fc-time fc-widget-content" style="width: 37px;"></td>
<td class="fc-widget-content"></td>
</tr>
<tr class="fc-minor">
<td class="fc-axis fc-time fc-widget-content" style="width: 37px;"></td
<td class="fc-widget-content"></td>
</tr>
<tr class="fc-minor">
<td class="fc-axis fc-time fc-widget-content" style="width: 37px;"></td>
<td class="fc-widget-content"></td>
</tr>
<tr>
<td class="fc-axis fc-time fc-widget-content" style="width: 37px;"><span>08:00</span></td>
<td class="fc-widget-content"></td>
</tr>
<tr class="fc-minor">
<td class="fc-axis fc-time fc-widget-content" style="width: 37px;"></td>
<td class="fc-widget-content"></td>
</tr> <!--etc-->
<tbody>
<table>
</div>
I want to use jquery to select every second td(day slots) that is follow the follow path
.$("fc-slats > table tbody tr").children.eq(1)
Is the above jquery correct?
回答1:
Your jquery isn't correct. You can use the following:
$(".fc-slats > table tbody tr").find("td:eq(1)")
来源:https://stackoverflow.com/questions/27229857/select-every-day-slot-on-jquery-full-calendar-ver-2-x