87,838
社区成员




<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
function split_str(string,words_per_line) {
var output_string = string.substring(0,1); //取出i=0时的字,避免for循环里换行时多次判断i是否为0
for(var i=1;i<string.length;i++) {
if(i%words_per_line == 0) {
output_string += "<br/>";
}
output_string += string.substring(i,i+1);
}
return output_string;
}
var title_value = '';
function title_show(td) {
var div=document.getElementById("title_show");
title_value = td.title;
div.style.left = (td.offsetLeft+230)+"px"; //设置title_show在页面中的位置。
var words_per_line = 25; //每行字数
var title = split_str(td.title,words_per_line); //按每行25个字显示标题内容。
div.innerHTML = title;
div.style.display = '';
td.title = ''; //去掉原有title显示。
}
function title_back(td) {
var div=document.getElementById("title_show");
td.title = title_value;
div.style.display = "none";
}
</script>
</head>
<body>
<table><tr><td onclick="update(this);" title="这里是很长很长很长很长很长
很长很长很长很长很长很长很长很长很长
很长很长很长很长很长很长很长很长很长
很长很长很长很长很长很长很长很长很长
很长很长很长很长很长很长很长很长很长的标题"
onmouseover="title_show(this);" onmouseout="title_back(this);">鼠标在这悬停显示标题</td></tr></table>
<div id='title_show'
style='position:absolute;
display:none;
border:solid 1px #999999;
background:#edeef0;
'>
</div>
</body>
</html>