我正在尝试使用 JavaScript 在用户第一次访问该站点时制作一个 lightwindow 显示。我正在使用 cookie,但目前我的代码当前设置为使用 window.open 方法打开一个弹出窗口。我想用从该站点http://www.p51labs.com/lightwindow/借来的灯箱替换 window.open 方法。谁能帮我用函数调用替换 window.open 方法来打开灯箱?
这是相关的代码,它检测用户是否是第一次访问并打开弹出窗口:
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, options) 函数,如下所示。请务必引用自动创建的 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
});"
提前感谢您的帮助!