Select every day slot on jquery full calendar ver 2.x

試著忘記壹切 提交于 2019-12-14 01:31:24

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!