简体   繁体   中英

Gallery and Fancybox

I am using the Gallery Snippet on MODx Revolution 2.1.5.

I am calling out the basic Gallery Snippet along with the specified Album.

I am trying to link Fancybox (jQuery Lightbox) up to the Thumbnails and images.

This is what MODx Outputs on the Resource:

<div class="gal-item"> 
<a href="path/to/page/test.html?galItem=1&galAlbum=1&galTag="> 
<img class="" src="/assets/components/gallery/connector.php?action=web/phpthumb&w=100&h=100&zc=1&far=C&q=90&src=%2Fassets%2Fcomponents%2Fgallery%2Ffiles%2F1%2F4.jpg" alt="lorem-ipsum-2.jpg" /> 
</a> 
</div>

I have selected the content correctly, When I click on the image wrapped in the link tag I get this message:

The requested content cannot be loaded. Please try again later.

How can it not be loaded? It's loading the Thumbnail and it needs the original image to create the Thumbnail. How can it not find the image?

Note: I am using the default setup for this Add-on.

Thank you!

As AlexC has mentioned I reckon it's to do with your big image path. Have you tried going to that URL direct and seeing if the image loads. You could trying removing the fancybox code and then click on the thumb and see if the link works as normal. The image should load on it's own in the browser window.

I can be am lots of causes why id does like that.

I think what it can be, you try to load content before you have this guy, I mean use some Ajax and it loads after you apply the "fancybox"

you can try this :

  1. remove the "fancybox" classname

  2. and use this code :

     $(".gal-item").live("click", function(){ var $href = $(this).find("a").attr("href"); var $href = $(this).attr("href"); $.fancybox({ href:$href }); 

    });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM