当前位置: 代码迷 >> Web前端 >> 内容截取展示
  详细解决方案

内容截取展示

热度:97   发布时间:2012-08-24 10:00:21.0
内容截取显示


$("#light tr td").each(function(i){
if($(this).attr("lang")!=undefined && $(this).attr("lang") == "tdTitle"){
if($(this).attr("id")==undefined || isNaN($(this).attr("id"))){
if($(this).text().length>200){
//$(this).attr("title",$(this).text());
$(this).text($(this).text().substring(0,200)+"...");
}
}else{

var length=$(this).attr("id");

if($(this).text().length>length){

$(this).text($(this).text().substring(0,length-4)+"...");
}
}
}
});
  相关解决方案