js:- $(function(){
- var DiquArr = ["湖南","山东","北京","广州","临沂","济南","驻马店","衡水","上海","沧州","四川","天津","苏州","成都","杭州","武汉","贵州","吉林","滨州","安徽","遵义","菏泽","南阳","新乡","北京","岳阳","郴州","许昌","连云港","大理","茂名","周口","秦皇岛","榆林","淮安","株洲","漳州","禹州","德州","菏泽","吉林","湖州","襄阳","江门","惠州","邯郸","郑州","天水","兰州","洛阳","宜昌","临沂","泰安","平顶山"];
- var RenArr = ["任先生","王女士","刘先生","刘女士","宋先生","吴女士","赵先生","孙女士","钱女士","武女士","孙先生","周先生","吴先生","吴女士","武先生","郑先生","周女士","郑女士","陈先生","冯女士","陈先生","冯女士","程先生","方女士","程先生","魏先生","魏女士","马女士","方先生","马先生","蒋先生","姜女士","蒋女士","姜先生","沈先生","沈女士","韩女士","杨先生","杨女士","尤女师","徐先生","朱先生","朱女士","秦先生","秦女士","尤先生","韩先生","何女士","吕先生","吕女士","石先生","洪先生","洪女士","孔先生","孔女士","曹先生","石女士","许先生","徐女士","许女士","何先生","张先生","张女士","曹女士","严先生","严女士"]
- setInterval(function(){
- //地区
- var n = Math.floor(Math.random() * DiquArr.length);
- var diqu=DiquArr[n];
- //console.log(diqu);
- $('.diqu').html(diqu);
- //人名
- var m = Math.floor(Math.random() * RenArr.length);
- var ren=RenArr[m];
- // console.log(ren);
- $('.ren').html(ren);
- $('.div09div').show(500); //将DIV标签显示出来。
- setTimeout(function(){
- $('.div09div').hide(500); //将DIV标签隐藏。
- }, 1500);
- },4000);
- })
复制代码
使用方法:
1,复制代码到js文件里
2,复制下方js引入到页面<head></head>里面
- <script src="js路径" type="text/javascript" charset="utf-8"></script>
复制代码
3,复制下方代码放到页面底部</body>上面
- <div class="div09div" style="width: 100%;height: auto;overflow: hidden;position: fixed;bottom: 75px;left: 0;display: none;">
- <div class="div09" style="width: 80%;height: 30px;line-height: 30px;overflow: hidden;font-size: 14px;margin: 0 auto;background: rgba(0,0,0,0.7);text-align: center;color: #fff;border-radius: 10px;">来自
- <span class="diqu"></span>的
- <span class="ren"></span>刚添加了微信好友
- </div>
- </div>
复制代码 |