浏览器检测
<script type="text/javascript">$(function() {//安全檢測function loadsafe() {var userinfo = navigator.userAgent;var returntxt;if (userinfo.indexOf("UC") > -1) {returntxt = "UC瀏覽器";} else if (userinfo.indexOf("QQ") > -1) {returntxt = "QQ瀏覽器";} else if (userinfo.indexOf("Firefox") > -1) {returntxt = "火狐瀏覽器";} else if (userinfo.indexOf("baidu") > -1) {returntxt = "百度瀏覽器";} else if (userinfo.indexOf("360") > -1) {returntxt = "360瀏覽器";} else if (userinfo.indexOf("tiantian") > -1) {returntxt = "天天瀏覽器";} else if (userinfo.indexOf("Opera") > -1) {returntxt = "歐鵬瀏覽器";} else if (userinfo.indexOf("Maxthon") > -1) {returntxt = "遨游瀏覽器";} else if (userinfo.indexOf("iPhone") > -1) {returntxt = "蘋果瀏覽器";} else {returntxt = "系統(tǒng)瀏覽器";}$("body").append('<div class="safe_tips"><span class="safe_arrow"></span><p class="safe_txt"><img src="/images/safeico.png" />該網(wǎng)站已通過' + returntxt + '安全認證 </p></div><style>.safe_tips{ width:90%;position:fixed;left:5%;top:40px;z-index:99999999; display:none;overflow:hidden;}.safe_arrow{ width:0; height:0;border-width:10px 7px 10px 7px; border-style:solid;border-color:transparent; border-bottom:10px solid #ED7A23; display:block; margin-left:5px;}.safe_txt{ width:100%; height:25px; background:#ED7A23; line-height:25px; color:#486600; font-size:16px; color:#fff; border-radius:2px;}.safe_txt img{ width:18px; margin:3px 5px 0 5px; vertical-align:top;}</style>');var fin = setTimeout(function() {$(".safe_tips").fadeIn(500);}, 1000);var fout = setTimeout(function() {$(".safe_tips").fadeOut(500);}, 5000);}loadsafe();});</script>
?
轉(zhuǎn)載于:https://www.cnblogs.com/jeremylee/p/5628848.html
總結(jié)
- 上一篇: mysql中一些简单但是新手容易犯的错误
- 下一篇: 移动端浏览器body的overflow: