View Full Version : JQuery Lightbox
dipper85
05-12-2010, 05:35 AM
Hi all,
I'm trying to implement the JQuery Lightbox to my site but the thumbs are just opening the large images in a new window and not running the script.
I've made sure all the locations are ok and followed the instructions for implementing the code but no luck.
I'm using a JQuery version as I believe the one on here doesn't work if jquery is running on a site.
Anyway any help would be greatly appreciated.
You can see what is happening on the site.
http://www.hamlinfistula.org.au/news/pastevents.html
jscheuer1
05-12-2010, 09:46 AM
Replace:
$(document).ready(function(){
base_url = document.location.href.substring(0, document.location.href.indexOf('index.html'), 0);
$(".lightbox").lightbox({
fitToScreen: true,
imageClickClose: false
});
$(".lightbox-2").lightbox({
fitToScreen: true
});
$(".lightbox-json").lightbox({
fitToScreen: true,
jsonData: new Array(
{url: base_url + 'images/image-0.jpg', title: 'Image 1 loaded using JSON data' },
{url: base_url + 'images/image-1.jpg', title: 'Image 2 loaded using JSON data' },
{url: base_url + 'images/image-2.jpg', title: 'Image 3 loaded using JSON data' },
{url: base_url + 'images/image-3.jpg', title: 'Image 4 loaded using JSON data' }
),
loopImages: true,
imageClickClose: false,
disableNavbarLinks: true
});
});
With:
jQuery(document).ready(function(){
jQuery(".lightbox-2").lightbox({
fitToScreen: true
});
});
Get rid of this:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js">
dipper85
05-12-2010, 11:25 PM
Hi John,
Thanks for the help but still no good. They are still just opening in a new window.
Can you recommend anything else?
jscheuer1
05-12-2010, 11:55 PM
First finish with the original suggestions. You still have not gotten rid of this:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js">
Please do so. After I removed that, it worked here in a local mock up, and the slide menu was fine without it, as it then used the 1.4.2 version.
dipper85
05-13-2010, 12:24 AM
Thanks John,
Got it now. Forgot that line was in the template. Got it working now.
Thank you again for your help.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.