我正在尝试使用插件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'});