Galleriffic with lightBox
For the relaunch of my clients site (craft2eu.net) I need to integrate Galleriffic with a lightBox. I know there is GallerificPlus, but it is based on an old version of Galleriffic which brings some things I don't like. For example the invalid attributes, etc.
How do I integrate the current version of Galleriffic (2.0 at the time of writin开发者_Go百科g this)?
I already followed trent's suggestion that can be found in the Galleriffic blog comments without any success.
I finally managed to make lightbox work with gallerfic. I'm using shadowbox, base/standard for images, including CSS support.
For my client's needs, it was OK to have an additional link below the image. To that end,
I simply used the "download" div to add a link to the same image as shown in the image-wrapper div. (I'm using PHP/MySQL to extract images from the db, so I have a loop in the <li>
section).
In the first straight-up implementation, the link would work, but the lightbox would not show up. I would only get the link to follow the src
and display the image in the same window, although I had specific the rel="lightbox"
in the link.
I realized that when hitting the back button and clicking the link again, the lightbox would actually work! After some research, I deducted that it was a preload image issue. I hence just added an img
tag above the ligthbox enabled link in my download div
with a width="0"
and height="0"
, plus border="0"
this actually loads the image on the page, but in hidden mode.
Also, to circumvent shadowbox loading to early and being unloaded by gallerific, I added onmouseover="shadowbox.init();"
to the download div, so that it would load again after an image load in the image-wrapper.
I admit it's a little bit of cheating, but it's working! Let me know if it works for you
精彩评论