<header>...</header>
)中加入js脚本路径<script type="text/javascript">
var GB_ROOT_DIR = "./greybox/"; 我的脚本放在了网站的根目录的greybox目录下
</script>
脚本包下载 (修改了gb_scripts.js中close按钮图片的路径)
使用很简单
<a href="http://www.cnblogs.com/5tao" title="毛毛虫" rel="gb_page_center[640, 480]">我的Blog in a 640x480 window</a>
<a href="http://google.com/" title="Google" rel="gb_pageset[search_sites]">Launch Google search</a>
只是在普通<a>中加入了title 和rel两个参数
title:模式窗口的标题
rel:模式窗口的样式。包括
rel="gb_page_center[640, 480]"
rel="gb_page_fs[]"
rel="gb_pageset[search_sites]"
使用函数调用
<script type="text/javascript">
GB_myShow = function(caption, url, /* optional */ height, width, callback_fn) {
var options = {
caption: caption,
height: height || 500,
width || 500,
fullscreen: false,
show_loading: false,
callback_fn: callback_fn
}
var win = new GB_Window(options);
return win.show(url);
}
</script>
<a href="http://google.com/" onclick="return GB_myShow('Google', this.href)">Visit Google without loading</a>
抛砖引玉,请多指教
更多内容来自:orangoo.com