【发布时间】:2014-02-26 00:50:45
【问题描述】:
我有一个 TableSorted 表,每个 TD 元素中有五个 SPAN 元素。四个总是隐藏的,但是在点击表格外的一个 div 时,某些 span 会被隐藏,具体取决于点击的是哪个 div。
我的表格排序很好,但我需要的是 textExtraction 抓取不同的 SPAN,具体取决于已选择的 div 的值。
我尝试了以下方法无济于事:
textExtraction:function(node){
var filter=$("div.career a.sel").text();
if(filter=="a"){var theindex=0;}
if(filter=="b"){var theindex=1;}
if(filter=="c"){var theindex=2;}
if(filter=="d"){var theindex=3;}
if(filter=="e"){var theindex=4;}
return $(node).find("span").eq(theindex).text();
}
实现这一目标的最佳方法是什么?
【问题讨论】:
标签: javascript jquery tablesorter