jquery实现显示隐藏微二维码的方法
代码如下:<!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=utf-8" />
<title>显示隐藏微信公众号</title>
<script type="text/javascript" src="jquery-1.8.3.min.js"></script>
<script type="text/javascript">
/**
* 显示隐藏二维码
*/
$(document).ready(function(e){
$(function () {
$(".er_wma").hide();
$(".wei_xin").mouseover(function () {
$(".er_wma").show();
});
$(".wei_xin").mouseout(function () {
$(".er_wma").hide();
});
});
});
</script>
<style type="text/css">
.er_wma {
width: 150px;
height: 150px;
position: fixed;
margin-left: -10px;
display: none;
background: url("weixin.jpg") no-repeat;
background-size: 100% 100%;
}
</style>
</head>
<body>
<span class="wei_xin">微信公众号<div class="er_wma"></div></span>
</body>
</html>
注:
jquery-1.8.3.min.js代码可从网上下载
页:
[1]