JS实现鼠标移上去显示图片或微信二维码

废话不多说了,直接给大家贴代码了。

<html> 
<head> 
<script type="text/javascript"> 
function showImg(){ 
document.getElementById("wxImg").style.display='block'; 
} 
function hideImg(){ 
document.getElementById("wxImg").style.display='none'; 
} 
</script> 
</head> 
<body> 
<a href="javascript:void(0)" onMouseOut="hideImg()" onmouseover="showImg()">测试</a> 
<div id="wxImg" style="display:none;height:50px;back-ground:#f00;position:absolute;">这里是微信图片</div> 
</body> 
</html>

相关推荐