代码如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
.code{
width: 49px;
height: 45px;
background:url("bgs.png");
position:fixed;
right: 10px;
top: 40%;
cursor: pointer;
}
.show{
display:block;
width: 149px;
height: 152px;
position: fixed;
right:59px;
top:40%;
background: url("456.png");
}
</style>
</head>
<body>
<div id="QRcode" class="code" onmouseover="showQR()" onmouseout="QR()"></div>
<script>
function showQR(){
document.getElementById("QRcode").classList.addClass('show');
//document.getElementById("QRcode").className="show";
}
function QR(){
document.getElementById("QRcode").className="code";
}
</script>
</body>
</html>