当前位置:   article > 正文

html+js自动弹出加QQ群的链接,每天只弹出一次_qq自动加群代码html

qq自动加群代码html
  1. <!-- QQ自动加群-->
  2. <div id="QQqun" style="position:fixed;right:5px;bottom:0px;display:none;z-index:999999;">
  3. <embed src="https://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=gccVsPaxG2pz4dvf9JOs6-lakaqNMVkA&authKey=CrQSUyx5zjv6eX6yiTj6CkjR%2F%2BJjz6Jeq4skTstMqMXt3GsZkZ6qZrJFtB%2FuhQqn&noverify=0&group_code=694331386" autostart="true" loop="true" ></embed>
  4. </div>
  5. <script type="text/javascript">
  6. $(function () {
  7. //每天只弹出一次
  8. var falg = getCookie("autoQun");
  9. if (!falg) {
  10. $("#QQqun").show();
  11. setCookie("autoQun", "1", 86400);
  12. }
  13. });
  14. //设置cookie
  15. function setCookie(name, value, liveMinutes) {
  16. if(liveMinutes == undefined || liveMinutes == null) {
  17. liveMinutes = 60 * 2;
  18. }
  19. if(typeof(liveMinutes) != 'number') {
  20. liveMinutes = 60 * 2; //默认120分钟
  21. }
  22. var minutes = liveMinutes * 60 * 1000;
  23. var exp = new Date();
  24. exp.setTime(exp.getTime() + minutes + 8 * 3600 * 1000);
  25. //path=/表示全站有效,而不是当前页
  26. document.cookie = name + "=" + value + ";path=/;expires=" + exp.toUTCString();
  27. }
  28. //获取cookie
  29. function getCookie(cname) {
  30. var name = cname + "=";
  31. var ca = document.cookie.split(';');
  32. for(var i = 0; i < ca.length; i++) {
  33. var c = ca[i];
  34. while(c.charAt(0) == ' ')
  35. c = c.substring(1);
  36. if(c.indexOf(name) != -1)
  37. return c.substring(name.length, c.length);
  38. }
  39. return "";
  40. };
  41. </script>

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/242236
推荐阅读
相关标签
  

闽ICP备14008679号