Lightview not functioning
I’ve used Lightview several times now and most times it’s worked straight away. This time I had a few issues. First off, the script files didn’t live in the usual place on the website, so I had to make sure I targeted them correctly so that effects.js, part of the scriptaculous / prototype library was active. It’s easy enough to test that a file is loading using Firebug in Firefox or the new Developer tools in Safari.
So the script files loaded OK, but clicking on the link for my first gallery image just gave me one picture in a new window. Two things, first I didn’t get the usual Lightview display (transparent background with white frame and rounded corners) as expected. This is solved by making sure that in the lightview.js file the reference to the Lightview images are relative to the script file, in most cases this is as easy as setting images: ‘images/’, around line 41, where images is a folder in the same level as lightview.js
The other issue was with showing a number of images in a gallery but without showing links to every image in the page. Sometimes showing links to all is useful for starting off part way through a set of images. However using just one “Gallery” link you can still show all the images by putting the first image reference in the Gallery link, then hiding all subsequent image links, thus:
<a class=”lightview” rel=”gallery[mygallery]” href=”http://localhost/_img/gallery/image_01.jpg”>Gallery</a>
<div style=”display: none;”>
<a class=”lightview” rel=”gallery[mygallery]” href=”http://localhost/_img/gallery/image_02.jpg”>Image #2</a>
<a class=”lightview” rel=”gallery[mygallery]” href=”http://localhost/_img/gallery/image_03.jpg”>Image #3</a>
<a class=”lightview” rel=”gallery[mygallery]” href=”http://localhost/_img/gallery/image_04.jpg”>Image #4</a>
</div>
There is further discussion on this in the forum here: http://www.nickstakenburg.com/forum/comments.php?DiscussionID=111
Now everything is working correctly you should get something like this:
For more information on Lightview visit: http://www.nickstakenburg.com/projects/lightview/
