PDA

View Full Version : lightbox2 problem


mrbli
07-23-2015, 07:13 AM
Hi fellas!
I found many helpful things around the site so I thought I'd sign up and see if someone can help me out with a little problem that I'm having.
I downloaded lightbox2 and I can't get it to work, even on a test page.
I copied lightbox.css and lightbox-plus-jquery.min.js in the root folder of my website, and added the navigation images to my /images folder of my website but all I get is the standard hyperlinking to a new page with the image displayed.

I should point out that while I do somewhat understand code, I'm very far from being a guru, so please keep it as simple as possible.
Here's the code for my test page:


<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<link href="lightbox.css" rel="stylesheet">
<script src="lightbox-plus-jquery.min.js"></script>
</head>

<body>
<div id="slide">
<a href="images/logo.jpg" data-lightbox="image-1" data-title="test 1">image 1</a>
</div>

</body>
</html>

Thanks for the help!

edbr
07-23-2015, 08:41 AM
not used it but is there not a lightbox.js as well as the jquery link?

like <script src="path/to/lightbox.js"></script>
as well as
<script src="path/to/jquery.js"></script>

mrbli
07-23-2015, 11:00 AM
Hey everyone!
Thanks for taking the time to reply edbr, but that wasn't the issue as the lightbox.js is the one with jquery included.

In case it can help anyone, I figured out the issue by picking apart some of the examples I found online. I noticed that most of them used:
<link rel="stylesheet" href="lightbox.css">

instead of:
<link href="lightbox.css" rel="stylesheet">

So I tried to put the REL before the HREF and just like magic it came to life! :p