标
function getLeft(e){
var offset=e.offsetLeft;
if(e.offsetParent!=null) offset+=getLeft(e.offsetParent);
return offset;
}
//alert(inputWidth+"----"+inputwidth+"----"+inputtopleft+"----"+inputtop);
}
//将返回数据添加到表格函数
function setNames(the_names) {
clearNames();
divsOffset();
for(var i=0;i<the_names.length;i++)
{
var nextNode=the_names[i].firstChild.nodeValue;
var row =document.createElement("tr");
var cell =document.createElement("td");
cell.onmouseout = function() {this.className="mouseOut";};
cell.onmouseover =(function(tdi) {return function(){k=tdi;setStyle(k);}})(i);
cell.setAttribute("bgcolor","#FFFAFA");
cell.setAttribute("border","0");
cell.setAttribute("style","font-size:15px");
cell.onclick = function() { populateName(this); };
//将nextNode添加到td
var txtName = document.createTextNode(nextNode);
cell.appendChild(txtName);
row.appendChild(cell);
nameTableBody.appendChild(row);
}
}
//点击选中一条数据,添加到inputField
function populateName(cell) {
//填充数据到web页面,cell---->td对象
inputField.value = cell.firstChild.nodeValue;
clearNames();
}
//设置样式
function setStyle(num)
{
var tBody = nameTableBody.getElementsByTagN |