我正在開發一個項目,我需要在一個頁面上顯示幾個拍賣的狀態。每個項目都有不同的結束日期。我使用cfquery
從數據庫中提取數據,然後使用cfoutput
構建表。那部分很好。那裏沒有問題。我的問題是,如何將Keith Wood's countdown timer的多個實例放在表格中,以便每個項目都有倒計時?html表中的多個jquery倒計時
這是我的表
<table id="large" class="tablesorter" border="0" CELLSPACING="1" CELLPADDING="0" width="50%">
<thead>
<tr class="tablesorter-headerRow">
<th id="itemnum" class="sorter-numeric">ItemNum</th>
<th id="highbidder" class="sorter-numeric">HighBidder</th>
<th id="closenum" class="sorter-numeric">Time Left</th>
<th id="highbidprice" class="sorter-numeric">HighBid</th>
</tr>
</thead>
<tbody>
<cfoutput>
<!--- Code builds the table body --->
<div class="countdown-styled clearfix" style="width:200px;"></div>
</cfoutput>
</tbody>
</table>
我已經看過這些頭:1)Jquery multiple coundown 2)multiple countdowns on same page with jquery但這些要麼似乎包括每個頁面中的唯一行ID,然後在其他一些jQuery代碼,或只是硬編碼的ID。這個問題是我不知道最終版本上有多少物品。現在我有35但這不是恆定的,所以我不能這樣做。任何想法或幫助嗎?會真的很感激它。
表體輸出是什麼樣的?它的結構將直接影響你用來觸發倒計時的jQuery。 – miah 2013-04-11 20:21:12