TinySort插件问题

时间:2014-12-24 08:58:43

标签: jquery sorting jquery-plugins

我正在尝试使用插件TinySort 1.5.6对div元素进行排序。但他没有工作。我的代码是:

<div id="ticketlist">               
     <div class="ticket" id="ticket1" data-price="7921.90">.....</div>
     <div class="ticket" id="ticket2" data-price="8000.00">.....</div>
     <div class="ticket" id="ticket3" data-price="3200.00">.....</div>
     <div class="ticket" id="ticket4" data-price="5234.23">.....</div>
     <div class="ticket" id="ticket5" data-price="4322.26">.....</div>
     <div class="ticket" id="ticket6" data-price="4234.25">.....</div></div>

Jquery代码:

$('#ticketlist .ticket').tsort('div',{data:'price'});

1 个答案:

答案 0 :(得分:1)

尝试$('#ticketlist div.ticket').tsort({data:'price'});

Fiddle