0
我使用jQuery来隐藏表中的行,直到今天的日期和这个作品:.nextUntil从第处通过指定日
$('.date_display').each(function(i, cell){
if (cell.scope == 'header') {
if ($(cell).text() == today){
return false;
}
}
$(cell).parent().hide();
});
但我似乎无法得到nextUntil
工作(jQuery的v 1.11 0.1):
var showMe = $("th.mz_date_display:contains('"+today+"')");
$('th.date_display').first().nextUntil(showMe, 'tr').hide();
showMe
正在返回在控制台的对象。
MWE HTML的:
<table>
<tr>
<th class="date_display">Monday</th>
</tr>
<tr>
<td class="date_display">some text</td>
</tr>
<tr>
<td class="date_display">some text</td>
</tr>
<tr>
<th class="date_display">Tuesday</th>
</tr>
<tr>
<td class="date_display">some text</td>
</tr>
<tr>
<td class="date_display">some text</td>
</tr>
<tr>
<th class="date_display">Wednesday</th>
</tr>
<tr>
<td class="date_display">some text</td>
</tr>
<tr>
<td class="date_display">some text</td>
</tr>
</table>
工作的例子就是,你可以创建一个演示小提琴,所以我们可以看到你们全部的javascript ,HTML,CSS等? – Yass
在您的问题中发布您的HTML。 – j08691
这里是我现在正在做的方式的一个小提琴:https://jsfiddle.net/mikeill/58cpt90f/1/ – MikeiLL