lightbox2无法在灯箱中打开图像

Jan*_*ath 3 lightbox lightbox2

我尝试将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>
Run Code Online (Sandbox Code Playgroud)

图像代码:

<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>
Run Code Online (Sandbox Code Playgroud)

我的问题是,当我点击缩略图时,它只会在空白的浏览器窗口中打开大图像,而不是在灯箱中打开它.

我已经检查了路径.浏览器控制台显示没有错误.

我想我错过了什么.但我不知道它会是什么.

会感激一些帮助.谢谢!

Ska*_*ina 6

根据Lightbox2主页的说明,您必须将脚本标记引用到标记/js/lightbox.js底部的文件</body>.

在结束<body>部分之前在页面底部包含Javascript :

<script src="path/to/lightbox.js"></script>
Run Code Online (Sandbox Code Playgroud)