首先,加入该DIV
然后加入两个js方法:
一个是当鼠标移上去时显示效果,另一个是当鼠标移开时清楚效果的。
好了,现在只需要在你需要的地方调用就可以了;
比如:
另外,如果你向让DIV透明,只需要把背景颜色去掉就OK了,即
<div id=pop
style=" position: absolute; width: 400;z-index: 11; display: none; background-color: #ffffdd">
</div>
然后加入两个js方法:
function cc(tt,desc,summ)
{
var e = document.getElementById("pop");
var t = tt.offsetTop; //TT控件的定位点高
var h = tt.clientHeight; //TT控件本身的高
var l = tt.offsetLeft; //TT控件的定位点宽
var ttyp = tt.type; //TT控件的类型
while (tt = tt.offsetParent){t += tt.offsetTop; l += tt.offsetLeft;}
e.style.top = (ttyp=="image")? t + h : t+10; //层的 Y 坐标
e.style.left = l + 50; //层的 X 坐标
e.style.display = "block"; //层显示
// e.innerText = "asdads"; ,${item.name},${item.name}
e.innerHTML = "工具简介:"+desc+"<br>改版履历:"+summ;
}
function aaclear(){
document.getElementById("pop").style.display = 'none';
}
一个是当鼠标移上去时显示效果,另一个是当鼠标移开时清楚效果的。
好了,现在只需要在你需要的地方调用就可以了;
比如:
<a href="tool.do?method=toVersionList&name=${item.name}"
onmouseover="cc(this,'${item.description}','${item.summary}')" onmouseout="return aaclear();">${item.name}</a>
另外,如果你向让DIV透明,只需要把背景颜色去掉就OK了,即
style=" position: absolute; width: 400;z-index: 11; display: none; "