这个论坛鼠标放在头像上旁边就显示一个信息框,怎么实现的
这个论坛鼠标放在头像上旁边就显示一个信息框,怎么实现的?
[解决办法]
<img onmouseover="try{showUserCard(this,'zxwangqiang')}catch(ex){};" src="http://avatar.profile.csdn.net/A/0/3/2_zxwangqiang.jpg">
[解决办法]
换图做个测试:参考:
<div align=center style="overfow: hidden; width: 100px; height: 100px">
<img src="3.jpg" width="100" height="100" border="0" onmouseover="show(this)" onmouseout="hide(this)">
</div>
<div align=center style="overfow: hidden; width: 100px; height: 100px">
<img src="1.jpg" width="100" height="100" border="0" onmouseover="show(this)" onmouseout="hide(this)">
</div>
<div align=center style="overfow: hidden; width: 100px; height: 100px">
<img src="2.jpg" width="100" height="100" border="0" onmouseover="show(this)" onmouseout="hide(this)">
</div>
<div id="enlarge_images" style="position: absolute; z-index:2"></div>
<SCRIPT>
function show(_this) {
document.getElementById("enlarge_images").innerHTML = "<img src='" + _this.src + "' >";
}
function hide(_this) {
document.getElementById("enlarge_images").innerHTML = "";
}
function move_layer(event){
event = event || window.event;
enlarge_images.style.left=event.clientX+document.body.scrollLeft+10;
enlarge_images.style.top=event.clientY+document.body.scrollTop+10;
}
document.onmousemove =move_layer;
</SCRIPT>