title 去掉显示时的空格跟换行,ddos配置域表,日志菜单更改sql提交

This commit is contained in:
zhanghongqing
2018-11-13 10:18:25 +08:00
parent 49d6a68b2b
commit 7444344ea2
4 changed files with 11 additions and 4 deletions

View File

@@ -37,11 +37,11 @@ $(function(){
//获取td当前对象的文本,如果长度大于25;
if($(this).text().trim().length>28){
//给td设置title属性,并且设置td的完整值.给title属性.
var strTitle = $(this).text().trim();
var strTitle = $(this).text().trim().replace(/[\r\n]/g,"").replace(/\s+/g, "");
//解决火狐title不能自动换行
var count = Math.floor(strTitle.length/64);
var count = Math.floor(strTitle.length/62);
for(var i=1;i<=count;i++){
strTitle=strTitle.substring(0,i*64-1)+"\n"+strTitle.substring(i*64-1);
strTitle=strTitle.substring(0,i*62-1)+"\n"+strTitle.substring(i*62-1);
}
$(this).attr("title",strTitle);
//获取td的值,进行截取。赋值给text变量保存.