For those of you interested in this functionality, I'm coming very close to achieving this. My work so far can be seen at
http://axia.entrecerebro.com/image-gallery2/. The first four images have a description that should display in the lightbox.
Now, it really needs some help to get it from 98.67% to 100%.
My solution isn't the best, but it's fairly functional and could {hopefully} inspire a better way of doing this.
Here's what I've done to get this far.
- This plugin seems to offer greater flexibility in withstanding this kind of torture.
- Enabled descriptions to be displayed, to the public, from the Joomgallery control panel
- Used jQuery to hide the description in the Category view (still needs to be optimized to avoid the flash of content)
- Modified leandrovieira's lightbox to display the description in the lightbox
Here are the issues that need addressing:
- The code used to hide the description is:
$(function(){
$("li:contains('Description')").hide();
});
I had to go this route since there is no <id> or <class> associated with the description. Finding and hiding the code this way isn't exactly eloquent, and is delayed. Maybe someone with more PHP experience could offer some advice as to how add a custom class so that it could be set to {display:none} from the get go.
- The second issue is my lack of greater javaScript knowledge. The descriptions are displayed in the pop-up, but the count I used isn't right.
The code used to select the description is:
var nextDesc = $("li:contains('Description'):eq(1)").show();
- line 245
There is an issue with
:eq(1)
There must be a better way to count.
The description is displayed by adding an append statement to the line that displayes the image caption:
.append(nextDesc);
- line 249
The entire function is:
function _show_image_data() {
// Finds Next List Item Containing "Description"
var nextDesc = $("li:contains('Description'):eq(1)").show();
$('#lightbox-container-image-data-box').slideDown('fast');
$('#lightbox-image-details-caption').hide();
if ( settings.imageArray[settings.activeImage][1] ) {
$('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show().append(nextDesc);
}
// If we have a image set, display 'Image X of X'
if ( settings.imageArray.length > 1 ) {
$('#lightbox-image-details-currentNumber').html(settings.txtImage + ' ' + ( settings.activeImage + 1 ) + ' ' + settings.txtOf + ' ' + settings.imageArray.length).show();
}
}
The entire file can be viewed at
http://axia.entrecerebro.com/image-gallery2/components/com_joomgallery/assets/js/lightbox2/js/jquery.lightbox-0.5.jsI'm sure many people would be very grateful to get this complete and add this capability to the already awesome Joomgallery solution.
I'll keep working on it, but my Javascript and PHP abilities are at their ends.
Thanks in advance!
~ Matt