我想在用户第一次访问网站时使用JavaScript来制作一个lightwindow显示。我正在使用cookies,但目前我的代码已设置为使用window.open方法打开弹出窗口。我想用我从这个网站借用的lightbox替换window.open方法http://www.p51labs.com/lightwindow/。任何人都可以帮助我用函数调用替换window.open方法来打开灯箱吗?JavaScript LightWindow代替用户第一次访问页面时弹出窗口
下面是相关检测代码,如果用户是第一次访问,并打开弹出:
function checkCount() {
var count = GetCookie('count');
if (count != null) {
count=1;
SetCookie('count', count, exp);
window.open(page, "", windowprops);
} else {
count++;
SetCookie('count', count, exp);
}
}
...这是谁创造了lightwindow作为编程报价如何
“创建和启动一个窗口的JavaScript调用
要做到这一点简单的调用activateWindow(ID,选项)功能显示如下。只是一定要引用自动创建myLightWindow对象或使用你拥有的那个选择了。
myLightWindow.activateWindow({
href: 'http://stickmanlabs.com/images/kevin_vegas.jpg',
title: 'Waiting for the show to start in Las Vegas',
author: 'Jazzmatt',
caption: 'Mmmmmm Margaritas! And yes, this is me...',
left: 300
});"
在此先感谢您的帮助!
只是为了澄清我的cookie设置为 count!= null用于测试目的。我知道最终这需要设置为count == null。 – IanGoodwin 2012-03-25 13:00:45