lightbox2 无法在灯箱中打开图像
lightbox2 doesn't open image in lightbox
我尝试将 Lightbox2 集成到现有网站中。
头部代码:
<head>
<link rel="stylesheet" media="screen" type="text/css" href="/css/style.css">
<link rel="stylesheet" type="text/css" href="/css/lightbox.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script type="text/javascript" src="/js/lightbox.js">
</head>
图片代码:
<div class="image-wrapper">
<a href="/img/projects/folder/image_big.jpg" data-lightbox="lightboxImage">
<img src="/img/projects/folder/image_thumbnail.jpg" alt=" " class="project-image">
</a>
</div>
我的问题是,当我单击缩略图时,它只会在空白浏览器中打开大图 window,而不是在灯箱中打开它。
我已经检查了路径。并且浏览器控制台没有显示任何错误。
我想我错过了什么。但我不知道它可能是什么。
希望得到一些帮助。谢谢!
根据 Lightbox2 Homepage 的说明,您必须将引用 /js/lightbox.js
文件的脚本标签放在 </body>
标签的底部。
Include the Javascript at the bottom of your page before the closing <body>
section:
<script src="path/to/lightbox.js"></script>
我尝试将 Lightbox2 集成到现有网站中。
头部代码:
<head>
<link rel="stylesheet" media="screen" type="text/css" href="/css/style.css">
<link rel="stylesheet" type="text/css" href="/css/lightbox.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script type="text/javascript" src="/js/lightbox.js">
</head>
图片代码:
<div class="image-wrapper">
<a href="/img/projects/folder/image_big.jpg" data-lightbox="lightboxImage">
<img src="/img/projects/folder/image_thumbnail.jpg" alt=" " class="project-image">
</a>
</div>
我的问题是,当我单击缩略图时,它只会在空白浏览器中打开大图 window,而不是在灯箱中打开它。
我已经检查了路径。并且浏览器控制台没有显示任何错误。
我想我错过了什么。但我不知道它可能是什么。
希望得到一些帮助。谢谢!
根据 Lightbox2 Homepage 的说明,您必须将引用 /js/lightbox.js
文件的脚本标签放在 </body>
标签的底部。
Include the Javascript at the bottom of your page before the closing
<body>
section:<script src="path/to/lightbox.js"></script>