启动 Shadowbox onload——如何让它加载页面?
我已经在链接上使用过 Shadowbox 多次,并且了解 href 会指导 Shadowbox 加载框中的页面,如下所示:
<a rel="shadowbox;width=700;height:500;" id="something" href="/page/iwantto/load/here.php">
但是,我现在需要在用户进入页面时立即显示一个 Shadowbox。不是 onclick,而是 onload。
我正在使用以下代码:
window.onload = function() {
// open a welcome message as soon as the window loads
Shadowbox.open({
content: '<div><a href="/some/path/here.php">Clicky</a></div>',
player: "html",
title: "A Title",
height: 600,
width: 700
});
};
来自 http://www.shadowbox-js.com/usage .html
任何比我更了解 Shadowbox 的人都意识到...这会产生一个带有链接词“clicky”的黑色 Shadowbox,当您单击时,父页面会定向到该链接。
我很抱歉在这里问这样一个基本问题,但我已经用谷歌搜索了几个小时,并阅读了 Shadow-js.com 上的一堆内容,但我没有找到打开 onload Shadowbox 所需的语法链接。我尝试添加这一行:
link: '/some/path/here.php',
但这也不是。我还阅读了一些有关 .setup 的内容,但不完全理解如何使用它。如果有人能为我指出正确的教程方向或解释一些代码,那就太好了。谢谢。
I've used Shadowbox on a link many times and understand that the href directs Shadowbox as to what page load in the box like this:
<a rel="shadowbox;width=700;height:500;" id="something" href="/page/iwantto/load/here.php">
However, I now need to have a shadowbox appear as soon as users come into the page. Not onclick, but onload.
I am using the following code:
window.onload = function() {
// open a welcome message as soon as the window loads
Shadowbox.open({
content: '<div><a href="/some/path/here.php">Clicky</a></div>',
player: "html",
title: "A Title",
height: 600,
width: 700
});
};
which comes from http://www.shadowbox-js.com/usage.html
As anyone who knows shadowbox better than I do realizes...this results in a black shadowbox with the linked word "clicky" and when you click, the parent page directs to the link.
I apologize for asking such a basic question on here but I've googled for a few hours and read through a bunch of stuff on shadow-js.com and I'm not finding the syntax I need to get the onload shadowbox to open up the link. I've tried adding this line:
link: '/some/path/here.php',
but that's not it either. I also read a bit about .setup but do not totally understand how to use it. If anyone can point me in the right direction for a tutorial or explain some code that would be great. Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
内容也错了,标题也没有必要。
Content its also wrong, and title its not neccesary.