3

I try to integrate Lightbox2 in an existing website.

Head Code:

<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>

Image Code:

<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>

My problem is when I click the thumbnail it only opens the big image in a blank browser window instead of opening it in a lightbox.

I already checked the paths. And the browser console shows no errors.

I think I just missed something. But I don't know what it could be.

Would appreciate some help. Thank you!

Jan Donath
  • 33
  • 1
  • 3

1 Answers1

6

According to instruction from the Lightbox2 Homepage you have to put the script tag refering to /js/lightbox.js file at the bottom of the </body> tag.

Include the Javascript at the bottom of your page before the closing <body> section:

<script src="path/to/lightbox.js"></script>
Community
  • 1
  • 1
Skamielina
  • 752
  • 6
  • 22