tablesorter按Facebook喜欢的数量排序?

时间:2013-07-24 08:57:35

标签: jquery facebook facebook-like tablesorter

我正在使用Jquery tablesorter创建一个表,我有一个显示Facebook喜欢按钮的列(带有“喜欢”旁边的计数器的列)。我想按显示的“喜欢”数量排序。我怎样才能做到这一点?

您可以在此处查看未完成的表格:http://fx-bar.com/brokers.html 这是我到目前为止所做的事情(我刚刚添加了Tabber脚本,但我之前也有过这个问题):

<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="/table/jquery-latest.js"></script>
<script type="text/javascript" src="/table/jquery.tablesorter.js"></script>
<script type="text/javascript" src="/tabber/tabber.js"></script>
<script type="text/javascript">
$(document).ready(function() 
    { 
        $("#myTable").tablesorter(); 
    } 
); 
</script>
<script type="text/javascript">
$(document).ready(function() 
    { 
        $("#myTable").tablesorter( {sortList: [[1,0]]} ); 
    } 
); 
</script> 
<link rel="stylesheet" type="text/css" href="/table/themes/blue/style.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/tabber/example.css" media="screen" />
</head>
<body>
<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<div class="tabber">

     <div class="tabbertab">
      <h2>Forex Brokers</h2>
<table id="myTable" class="tablesorter">
<thead>
<tr>
    <th>Broker Name</th>
    <th>Popularity</th>
    <th>Min Deposit</th>
    <th>Leverage</th>
    <th>Promotions</th>
</tr>
</thead>
<tbody>
<tr>
    <td>FXPrimus</td>
    <td><div class="fb-like" data-href="http://www.myforexspace.org/page/fxprimus-review" data-send="false" data-layout="button_count" data-width="50" data-show-faces="true"></div></td>
    <td>$100</td>
    <td>500:1</td>
    <td>Free 1 on 1 coaching with a professional trader!</td>
</tr>
<tr>
    <td>AvaFX</td>
    <td><div class="fb-like" data-href="http://www.myforexspace.org/page/ava-fx-review" data-send="false" data-layout="button_count" data-width="50" data-show-faces="true"></div></td>
    <td>$100</td>
    <td>400:1</td>
    <td>Up to $5000 Bonus!</td>
</tr>
<tr>
    <td>Doe</td>
    <td>Jason</td>
    <td>jdoe@hotmail.com</td>
    <td>$100.00</td>
    <td>http://www.jdoe.com</td>
</tr>
<tr>
    <td>Conway</td>
    <td>Tim</td>
    <td>tconway@earthlink.net</td>
    <td>$50.00</td>
    <td>http://www.timconway.com</td>
</tr>
</tbody>
</table></div>
<div class="tabbertab">
      <h2>Binary Options Brokers</h2>
<table id="myTable" class="tablesorter">
<thead>
<tr>
    <th>Broker Name</th>
    <th>Popularity</th>
    <th>Min Deposit</th>
    <th>Leverage</th>
    <th>Promotions</th>
</tr>
</thead>
<tbody>
<tr>
    <td>FXPrimus</td>
    <td><div class="fb-like" data-href="http://www.myforexspace.org/page/fxprimus-review" data-send="false" data-layout="button_count" data-width="50" data-show-faces="true"></div></td>
    <td>$100</td>
    <td>500:1</td>
    <td>Free 1 on 1 coaching with a professional trader!</td>
</tr>
<tr>
    <td>AvaFX</td>
    <td><div class="fb-like" data-href="http://www.myforexspace.org/page/ava-fx-review" data-send="false" data-layout="button_count" data-width="50" data-show-faces="true"></div></td>
    <td>$100</td>
    <td>400:1</td>
    <td>Up to $5000 Bonus!</td>
</tr>
<tr>
    <td>Doe</td>
    <td>Jason</td>
    <td>jdoe@hotmail.com</td>
    <td>$100.00</td>
    <td>http://www.jdoe.com</td>
</tr>
<tr>
    <td>Conway</td>
    <td>Tim</td>
    <td>tconway@earthlink.net</td>
    <td>$50.00</td>
    <td>http://www.timconway.com</td>
</tr>
</tbody>
</table></div>
</div>

</body>
</html> 

0 个答案:

没有答案