欢迎大家加入创想工作室QQ群 网络瘫痪上不了网?电脑出故障?找破解软件?加入创想工作室QQ群,向大神求助,一步解决问题!QQ群号码:326338868[点此获取更多QQ群]
我们先看一下效果
 
 
 
是不是很酷呢?很多网站也在用,今天分享一下了,代码也很少。
 
首页是JS代码
 
function showwx()
{
document.getElementById('qqgroup').style.display='block';
}
function hidwx()
{
document.getElementById('qqgroup').style.display='none';
}
 
然后是HTML代码
 
<a href="javascript:void(0)" class="qqgroup" onmouseover="showwx()" onmouseout="hidwx()"></a>
 
在需要出现二维码的地方加上下面代码
 
<div id="qcode" class="center"><div id="qqgroup"></div></div>
 
最后就是定义样式啦!下面的仅供参考!
 
#qcode { position:relative; margin:0 auto; }
#qqgroup { display:none; position:absolute; overflow:hidden; background:url(templates/images/qqgroup.png) no-repeat; width:150px; height:150px; z-index: 2000000; left:-50px; top:30px; }
 
完整代码如下
 
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>创想技术网</title>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<style>
#qcode { position:relative; margin:0 auto; }
#qqgroup { display:none; position:absolute; overflow:hidden; background:url(templates/images/qqgroup.png) no-repeat; width:150px; height:150px; z-index: 2000000; left:-50px; top:30px; }
</style>
<script type="text/javascript">
function showwx()
{
document.getElementById('qqgroup').style.display='block';
}
function hidwx()
{
document.getElementById('qqgroup').style.display='none';
}
</script>
</head>
<body>
<div id="header">
<div class="top">
    <div class="wrapper">
        <div class="left"><a href="https://www.22ba.com/">创想工作室首页</a></div>
        <div class="right">
            <div id="qcode" class="center"><div id="qqgroup"></div></div>
            <a href="javascript:void(0)" class="qqgroup" onmouseover="showwx()" onmouseout="hidwx()"></a><a class="mobile" href="http://m.22ba.com/"></a>
            </div>
        </div>
    </div>
</div>
</body>
</html>

© copyright 2002-2024, 22BA.COM All Rights Reserved

网站备案号:粤ICP备19114910号

ChuangXiang Design Studio - WebDesign & Internet Marketing

关于我们业务范围联系我们开心一刻网站地图

QQ群一:326338868QQ群二:78712271

QQ群三:193078177

邮箱:news@22ba.com

地址:深圳市福田区金田路现代国际大厦2606