GreyBox FAQ
原文地址
Q:我需要下载哪些文件以使GreyBox工作?
你只需要解压后的GreyBox文件夹中的GreyBox文件夹即可。
Q:图片无法显示,或只在位于GreyBox文件夹中才显示?
你的GB_ROOT_DIR没有设置正确。
Q:我怎样制作自己的关闭链接/按钮?
Q:我怎样用GreyBox加载页面?
GreyBox用的是AJS库自带的页面加载命令
AJS.AEV(window, 'load', function() { GB_show("Hello world","http://google.com"); });
Q:怎样使GreyBox不出现加载页面?
标准的GB_show如下:
GB_show = function(caption, url, /* optional */ height, width, callback_fn) {
var options = {
caption: caption,
height: height || 500,
width: width || 500,
fullscreen: false,
callback_fn: callback_fn
}
var win = new GB_Window(options);
return win.show(url);
}
因为在greybox/base/base.js里,我们默认的参数是这样的:
init: function(options) {
this.type = "page";
this.overlay_click_close = false;
this.salt = 0;
this.root_dir = GB_ROOT_DIR;
this.callback_fns = [];
this.reload_on_close = false;
this.src_loader = this.root_dir + 'loader_frame.html';
this.show_loading = true;
AJS.update(this, options);
},
可以看到show_loading默认参数为true,所以我们可以新建一个函数(暂时命名为GB_myShow)
GB_myShow = function(caption, url, /* optional */ height, width, callback_fn) {
var options = {
caption: caption,
height: height || 500,
width: width || 500,
fullscreen: false,
show_loading: false,
callback_fn: callback_fn
}
var win = new GB_Window(options);
return win.show(url);
}
注意里面的show_loading为false,接着引用这个函数即可
同理,我们还可以对overlay_click_close进行修改,以实现点击关闭的效果。
Q:使用WordPress?
WordPress可以创建二级目录,所以请使用绝对路径
Q:使用Google Maps?
用Google API或到论坛寻求帮助。
Q:在用Dreamweaver制作的网页中无法使用?
从脚本中删去函数MM_imagePreloader,然后修改
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home