鼠标悬停事件

  173 次阅读

CONTENT

当鼠标悬停到某一元素时激活事件

js代码:

  1. function  showImg(){
    
  2.     document.getElementById("wxImg").style.display='block';
    
  3.     }
    
  4.     function hideImg(){
    
  5.     document.getElementById("wxImg").style.display='none';
    
  6.     }

HTML代码:

  1. <a href="javascript:void(0)" onMouseOut="hideImg()"  onmouseover="showImg()" textvalue="立刻购买">立刻购买</a>
  2. <p id="wxImg" style="display: none; text-align: center; margin: 10px auto auto; position: relative; width: 140px;"><img src="/uploads/180506/1-1P50615401XC.png" style="float: none;width:140px;height: 140px;">手机扫一扫购买</p>

Comments | NOTHING

暂无评论...