css3鼠标经过显示图片

 <div class="menu" >
     <div class="order">
          <a href="#" class="item-l iconfont">
              <?= Html::img($this->theme->getAssetUrl('images/icon.png')) ?>
          </a>
          <span class="tips ta-r">扫一扫</span>
     </div>          
</div>
<div class="showpic-l">
     <?= Html::img($this->theme->getAssetUrl('images/footer-qrcode@2x.png')) ?>
     <div>扫码</div>
 </div>   
 

此场景是鼠标经过扫码图标,显示二维码图片 ,css样式如下:

.showpic-l {
    display: none;
    position: absolute;
    top: 56px;
    right: 310px;
    width: 172px;
    line-height: 28px;
    text-align: center;
    padding: 20px 17px 12px 20px;
    z-index: 9999;
    border: 3px solid #32ccfe;
    min-width: 10rem;
    font-size: 1rem;
    color: #333;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    /* border: 1px solid rgba(0, 0, 0, 0.15); */
    border-radius: 0.25rem;
}

.showpic-l::before {
    position: absolute;
    content: "";
    width: 0;
    height: 0;
    border: 20px solid;
    top: -43px;
    left: 60px;
    border-color: transparent transparent #32ccfe;
}

.showpic-l::after {
    content: "";
    width: 0;
    height: 0;
    border: 20px solid;
    position: absolute;
    top: -40px;
    left: 60px;
    border-color: transparent transparent white;
}

jq如下:(还有很多鼠标经过显示隐藏的写法,更多写法查看jq手册)

 //鼠标经过显示二维码
    $(".item-l").mouseover(function() {
        $(".showpic-l").show();
    });
    $(".item-l").mouseout(function() {
        $(".showpic-l").hide();
    });

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值