日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

超nb的网页标签弹窗js代码!

發布時間:2023/11/27 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 超nb的网页标签弹窗js代码! 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

首先說一下業務需求:

需要在當前各主流瀏覽器上從tab標簽形式彈出一個頁面,盡量不要以單獨窗口彈出。

下面是網上搜集并修改、驗證后的js代碼,以備以后參閱。

function getUnionCookie(B) {var A = new RegExp(B + "=([^;]+)"), _ = A.exec(document.cookie), $ = "";if (_ != null) {try {$ = decodeURI(_[1]);}catch (C) {}}return $;
}function setUnionCookie(sName, sValue, oExpires, sPath) {document.cookie = sName + "=" + escape(sValue) + ";expires=" + oExpires.toUTCString() + ";path=" + sPath;
}//使用cookie控制每隔24小時彈一次,似乎不見效
function updateunionli() {var exp2 = new Date();exp2.setTime(exp2.getTime() + 24 * 60 * 60 * 1000);setUnionCookie("unionli_lc", 4 + 1, exp2, '/');var poped_statist = new Image();poped_statist.src = "http://www.anmeiqi.com/logo/anmeiqi.gif"; //廣告的統計的url
}var anmeiqi_url = 'http://www.anmeiqi.com/';//要推廣的url
var is_unionli_poped = getUnionCookie('unionlipop');
if (!is_unionli_poped) {var unionli_pidx = getUnionCookie('unionli_lc');if (!unionli_pidx)unionli_pidx = 1;(function() {var aa_url = window.anmeiqi_url;var _has2ap = 0;var ua = navigator.userAgent;var browser = {ie: /msie/i.test(ua),ie6: /msie 6/i.test(ua),ie7: /msie 7/i.test(ua),ie8: /msie 8/i.test(ua),ie9: /msie 9/i.test(ua),360: /360se/i.test(ua),sogou: /;?se.+?MetaSr/i.test(ua),maxthon: /Maxthon/i.test(ua),tt: /TencentTraveler/i.test(ua),ff: /firefox/i.test(ua),webkit: /AppleWebKit/i.test(ua),opera: /Opera/i.test(ua),qqbrowser: /QQBrowser/i.test(ua),theworld: /Theworld/i.test(ua)};function ev_op(e, event, func, act) {if (browser.ie)e[act === undefined ? 'attachEvent' : 'detachEvent']('on' + event, func);elsee[act === undefined ? 'addEventListener' : 'removeEventListener'](event, func, false)}//彈窗效果頂層包裝函數function pop(url, param) {if (!document.body) {return setTimeout(function() {pop(url, param)}, 13)}try {if (browser['webkit'] && browser['maxthon']) {if (!core_pop(url)) {a_pop(url)}} else if (browser['tt']) {try {object_pop(url)} catch (e) {a_pop(url)}} else if (browser['sogou']) {if (!core_pop(url)) {a_pop(url)}} else if (browser['webkit'] && browser['qqbrowser']) {if (!core_pop(url)) {click_pop(url)}} else if (browser['webkit'] || browser['opera']) {a_pop(url)} else if (browser['theworld'] && browser.ie6) {if (!object_pop2(url)) {a_pop(url)}} else if (browser['theworld'] && browser.ie8) {if (!core_pop(url)) {try {object_pop(url)} catch (e) {click_pop(url)}}} else if (browser.ie6) {if (!core_pop(url)) {object_pop2(url)}} else if (browser.ie8) {if (!core_pop(url)) {document.onclick = function() {core_pop(url);document.onclick = null}}} else if (browser['ie']) {try {object_pop(url)} catch (e) {click_pop(url)}} else if (browser['ff']) {if (!core_pop(url)) {click_pop(url)}} else {if (!core_pop(url)) {click_pop(url)}}_has2ap = 1;updateunionli()} catch (e) {if (browser.ie7 || browser.ie8 || browser.ie9 || browser['qqbrowser']) {click_pop(url)} else {a_pop(url)}_has2ap = 1;updateunionli()}}function append(e) {for (var t in {body: 1}) {var ele = document.getElementsByTagName(t);for (var i = 0; i < ele.length; i++) {ele[i].insertBefore(e, ele[i].firstChild);return}}}function object_pop(url, param) {var object = document.createElement('object');object.setAttribute('classid', 'CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6');object.style.cssText = 'position:absolute;left:1px;top:1px;width:1px;height:1px;';append(object);object.launchURL(url)}function object_pop2(url, param) {var object2 = document.createElement('object');object2.setAttribute('classid', 'clsid:2D360201-FFF5-11d1-8D03-00A0C959BC0A');object2.style.cssText = 'position:absolute;left:1px;top:1px;width:1px;height:1px;';append(object2);for (var i in object2) {try {(function(o) {})(object2[i])} catch (e) {}}setTimeout(function() {object2.DOM.Script.open(url, '_blank', '')}, 500)}//監視到mouseup事件后異步取消,然后彈窗function click_pop(url, param) {ev_op(document, 'mouseup', function(e) {e = e || window.event;e.canceBubble = true;ev_op(document, 'mouseup', arguments.callee, true);core_pop(url, param)})}function a_pop(url) {var a = document.createElement('a');a.href = url;a.target = '_blank';var div = document.createElement('div');div.style.backgroundColor = '#ffffff';a.style.filter = 'alpha(opacity=0)';a.style.opacity = '0';a.appendChild(div);append(a);a.style.display = 'block';a.style.cursor = 'default';a.style.position = 'absolute';a.style.left = '0px';a.style.top = '0px';a.style.zIndex = 999999;var i = setInterval(function() {var d = document.documentElement || document.body;a.style.top = Math.max(document.documentElement.scrollTop, document.body.scrollTop) + 'px';div.style.width = Math.min(d.clientWidth, d.scrollWidth) + 'px';div.style.height = d.clientHeight + 'px'}, 200);a.onclick = function(e) {setTimeout(function() {a.parentNode.removeChild(a)}, 200);clearInterval(i)};a.onmouseup = function(e) {e = e || window.event;e.canceBubble = true}}function core_pop(url, param) {var w = window.open(url, '_blank', 'left=0,top=0,toolbar=yes,location=yes,' + 'status=yes,menubar=yes,scrollbars=yes,' + 'resizable=yes,width=' + screen.width + ',height=' + screen.height);return w}//調用彈窗函數入口setTimeout(function() {pop(aa_url, {a: 1,b: 2})}, 300);ev_op(window, 'beforeunload', function() {})})();
}


總結

以上是生活随笔為你收集整理的超nb的网页标签弹窗js代码!的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。