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;">
    <img src="https://i.loli.net/2020/02/17/fACYLUMDdxyrnTe.jpg">
</div> 
</body> 
</html>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM