Results 1 to 5 of 5

Thread: JQuery Lightbox

  1. #1
    Join Date
    Feb 2009
    Posts
    17
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default JQuery Lightbox

    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

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Replace:

    Code:
    		$(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:

    Code:
    		jQuery(document).ready(function(){
    
    			
    			jQuery(".lightbox-2").lightbox({
    			    fitToScreen: true
    		    });
    			
    		    
    		});
    Get rid of this:

    Code:
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js">
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Feb 2009
    Posts
    17
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Hi John,

    Thanks for the help but still no good. They are still just opening in a new window.

    Can you recommend anything else?

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    First finish with the original suggestions. You still have not gotten rid of this:

    Code:
    <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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. The Following User Says Thank You to jscheuer1 For This Useful Post:

    dipper85 (05-13-2010)

  6. #5
    Join Date
    Feb 2009
    Posts
    17
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Thanks John,

    Got it now. Forgot that line was in the template. Got it working now.

    Thank you again for your help.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •