10
2017
12

js鼠标指上去后出现二维码

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title>无标题文档</title>

<script src="http://www.w3school.com.cn/jquery/jquery-1.11.1.min.js"></script>

<style type="text/css">

.wxa {position:relative}

.wximg {width:97px; height:99px; position:absolute; right:-105px; bottom:-25px; display:none;}

</style>

</head>


<body>

<br><br><br><br>

<a href="javascript:void(0)" class="wxa">

测试

<div class="wximg" style="display: none;"><img src="http://www.scyzdz.com/images/sec.jpg" width="97" height="99"></div>

</a>



<script>

    $(document).ready(function () {

//鼠标移上出现二维码

      $(".wxa").hover(

        function () {

            $(this).find(".wximg").stop(true, true).fadeIn(300);

        },

        function () {

            $(this).find(".wximg").stop(true, true).fadeOut(300);

        });

    });

</script>

</body>

</html>


« 上一篇下一篇 »