我正在尝试使用 Greybox,但我对它找不到我想要显示的图像感到沮丧。我认为这可能与相对 URL 和没有指向正确的位置有关。但我不确定。我觉得我已经尝试了所有可能的 URL 组合。
这是问题,还是我完全错过了什么?我在这里阅读了有关 Greybox 的常见问题解答:http://orangoo.com/labs/GreyBox/FAQ/但它并没有真正为我提供解决方案。
我将非常感谢任何帮助。谢谢。
注意:看起来服务器区分大小写。
相关页面的 URL 为:http: //www.ecometrix.ca/refresh/emma.html 图像位于:/refresh/emma/images/ 图像标记为:screen01.jpg、screen02.jpg、screen03.jpg 等.
这是我的 HTML 标题中的灰框内容:
<script type="text/javascript">
var GB_ROOT_DIR = "http://www.ecometrix.ca/refresh/greybox/";
</script>
<script type="text/javascript" src="greybox/AJS.js"></script>
<script type="text/javascript" src="greybox/AJS_fx.js"></script>
<script type="text/javascript" src="greybox/gb_scripts.js"></script>
<link href="greybox/gb_styles.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/refresh/banner/Scripts/AC_RunActiveContent.js"></script>
这是我定义的图像集(现在使用绝对 URL):
<script type="text/javascript">
var image_set = [{'caption': 'Screenshot 1', 'url': 'http://www.ecometrix.ca/refresh/images/screen01.jpg'},
{'caption': 'Screenshot 2', 'url': 'http://www.ecometrix.ca/refresh/images/screen02.jpg'},
{'caption': 'Screenshot 3', 'url': 'http://www.ecometrix.ca/refresh/images/screen03.jpg'},
{'caption': 'Screenshot 4', 'url': 'http://www.ecometrix.ca/refresh/images/screen04.jpg'},
{'caption': 'Screenshot 5', 'url': 'http://www.ecometrix.ca/refresh/images/screen05.jpg'}];
</script>
这是 HTML 中的锚标记:
<a href="" class="emmalink" onclick="return GB_showImageSet(image_set, 1)">Screenshots</a>
编辑: 这是对我有用的代码:
在和标签之间:
<script type="text/javascript">
var GB_ROOT_DIR = "http://www.ecometrix.ca/refresh/greybox/";
</script>
<script type="text/javascript" src="http://www.ecometrix.ca/refresh/greybox/AJS.js"></script>
<script type="text/javascript" src="http://www.ecometrix.ca/refresh/greybox/AJS_fx.js"></script>
<script type="text/javascript" src="http://www.ecometrix.ca/refresh/greybox/gb_scripts.js"></script>
<link href="http://www.ecometrix.ca/refresh/greybox/gb_styles.css" rel="stylesheet" type="text/css" />
和
<script type="text/javascript">
var image_set = [{'caption': 'Screenshot 1', 'url': 'http://www.ecometrix.ca/refresh/emma/images/screen01.jpg'},
{'caption': 'Screenshot 2', 'url': 'http://www.ecometrix.ca/refresh/emma/images/screen02.jpg'},
{'caption': 'Screenshot 3', 'url': 'http://www.ecometrix.ca/refresh/emma/images/screen03.jpg'},
{'caption': 'Screenshot 4', 'url': 'http://www.ecometrix.ca/refresh/emma/images/screen04.jpg'},
{'caption': 'Screenshot 5', 'url': 'http://www.ecometrix.ca/refresh/emma/images/screen05.jpg'}];
</script>
在身体里:
<a href="" class="emmalink" onclick="return GB_showImageSet(image_set, 1)">Screenshots</a>