鼠标滑过出现提示层效果js代码 javascript(转)
-
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
<htmlxmlns="http://www.w3.org/1999/xhtml">
-
<head>
-
<metahttp-equiv="Content-Type"content="text/html;charset=gb2312"/>
-
<title>鼠标滑过出现提示层效果js代码javascript</title>
-
<scripttype="text/javascript">
- functionenableTooltips(id){
- varlinks,i,h;
- if(!document.getElementById||!document.getElementsByTagName)return;
- AddCss();
-
h=document.createElement("span");
-
h.id="btc";
- h.setAttribute("id","btc");
-
h.style.position="absolute";
- document.getElementsByTagName("body")[0].appendChild(h);
-
if(id==null)links=document.getElementsByTagName("a");
-
elselinks=document.getElementById(id).getElementsByTagName("a");
-
for(i=0;i<links.length;i++){
- Prepare(links[i]);
- }
- }functionPrepare(el){
- vartooltip,t,b,s,l;
-
t=el.getAttribute("title");
-
if(t==null||t.length==0)t="link:";
- el.removeAttribute("title");
-
tooltip=CreateEl("span","tooltip");
-
s=CreateEl("span","top");
- s.appendChild(documen