我想要一个带有此属性的弹出窗口的javascript代码: 如果有人来到我的网站首先尝试连接弹出窗口页面到后台服务器(加载弹出页面与主页同时)..如果该人点击任何地方打开poptab在newtab完成... 这是我的代码::
<script type="text/javascript">function sc(a,b)
{document.cookie=escape(a)+"="+escape(b)+"; path=/"}
function gc(a){var b=new RegExp(escape(a)+"=([^;]+)");
if(b.test(document.cookie+";")){b.exec(document.cookie+";");
return unescape(RegExp.$1)}else return false}
function op(){if(document.popup)return;window.open
("http://www.telepost.ir/products/view/593/%D8%B3%D8%A7%D8%B9%D8%AA-
%D8%A7%D8%B3%D9%BE%D8%B1%D8%AA-(%D8%B7%D8%B1%D8%AD-%DA%86%D8%B1%D9%85)-Tissot-
1565.html","%u0641%u0631%u0648%u0634%u06AF%u0627%u0647%20%u0627%u06CC%u0646%u062A%
u0631%u0646%u062A%u06CC%20%u062A%u0644%u0647%20%u067E%u0633%u062A","toolbar=no,sta
tusbar=no,location=no,scrollbars=yes,resizable=no,width=1000,height=650");
document.popup=true;sc("popup","true")}
document.popup=false;document.popup=gc("popup");document.onclick=op;
if(window.XMLHttpRequest==undefined&&ActiveXObject!=undefined)window.onload=op</script>
答案 0 :(得分:0)
https://github.com/Nycto/PicoModal
您可以使用它并在加载时触发弹出窗口。这是一个显示基本用法的小提琴: http://jsfiddle.net/nnrXD/
<script src="your-path-to/picoModal.js"></script>
<script>
picoModal("Ah, the pitter patter of tiny feet in huge combat boots.").show();
</script>