Support » Plugin: WP jQuery Lightbox » [Plugin: WP jQuery Lightbox] Title-captions Bug found, solved, and fix proposed

  • Resolved josephknight

    (@josephknight)


    Hi Ulf,
    Thanks first of all for such a simple and elegant lightbox solution for wordpress.

    However I found a bug and coded in a little solution.
    Bug
    If some images in a set have the link title set and the rest of the images do not then this bug happens:
    When flipping through the lightbox pages the title-less links should not have a caption. However all the title-less images in the set will contain the last image’s caption when flipping through. In other words, there’s no code that says “hey if this image doesn’t have the ahref title element set, then hide the caption.

    You can replicate this bug by creating a set of 2 images in a post and then give only one of their surround link’s a title attribute. The caption will show up for the image with the titled link and will carry over to the image with the un-titled link (even tho this image should not have a caption).

    I found this code in the original jquery lightbox plugin and inserted it into your wp plugin. It hides the caption just before each image is paged into view and only shows it if the title actually contains something. It’s just 2 lines of code:

    ——————————————

    function updateDetails() {
    		    jQuery('#numberDisplay').html('');
    
    		    /* BEGIN ADDITION */
       			$('#imageDataContainer').slideDown('fast');//<-- important but missing from your version
    			$('#caption').hide();//<-- important but missing from your version
    		    /* END ADDITION */
    
    		    if(opts.imageArray[opts.activeImage][1]){
    			    jQuery('#caption').html(opts.imageArray[opts.activeImage][1]).show();
    		    }

    ——————————————

    I beg you to make an awesome plugin even closer to perfect and add this code then update the plugin in the wordpress plugin repository.

    Thanks for your port, it’s my favorite.

Viewing 15 replies - 1 through 15 (of 20 total)
  • Thread Starter josephknight

    (@josephknight)

    Also, in the admin page for the plugin, in your example you tell the folks that to use groups enter a rel attribute with “lightbox” plus the groupname. However you proceed to show them an example of:

    <a href="images/image-1.jpg" rel="roadtrip[roadtrip]">image #1</a>
    <a href="images/image-2.jpg" rel="roadtrip[roadtrip]">image #2</a>
    <a href="images/image-3.jpg" rel="roadtrip[roadtrip]">image #3</a>

    These should be:

    ... rel="lightbox[roadtrip]" ...

    Fixed. WordPress will notify you of the version 1.1 release soon.

    Many thanks!

    Nice work indeed, Ulf…many thanks! Any suggestions on how to get the captions/descriptions from media images to automatically display under the title in the lightbox display?

    My apologies if I’m missing something simple…

    Grab the development version here and let me know if it works.

    * Added support for Media Library titles and captions.
    * Minified the javascript (8.6KB vs 17.8KB)
    * Minified the CSS (2.0KB vs 2.7KB)

    Note that descriptions are never output with the default gallery-shortcode, so they’re not available for the lightbox.

    However, if you use the Cleaner Gallery plugin you can have captions auto-linked to the attachments’ own post (where description, commenting etc are all available). This works fine with my plugin to. 🙂

    Worked like a charm! And thanks for the tip about the Cleaner Gallery plugin…I’ll try that out as it sounds exactly like what I was hoping to do (add a “view details” link in the caption section of the ligthbox). Thanks again!

    Ulf –
    I found a bug with the new version of the plugin.

    I’m going to just put in some representative code, as the site is for a client and off-limits:

    [caption id="attachment_1228" align="alignright" width="227" caption="The photo caption"]<img src=”http://www.sd.com/wp-content/uploads/2010/10/the-photo.jpg&#8221; alt=”” width=”227″ height=”300″ class=”size-medium wp-image-1228″ />[/caption]

    What was happening here was that the caption was being duplicated, as your plugin seemed to be picking up the [caption] in addition to the “title” as the caption. I had to switch to another lightbox plugin due to this bug. (Lightbox 2)

    Please let me know if you need any more info, or if this makes sense.

    That’s intended. The plugin will pick out title *and* caption and use them both when available.

    Since it seems common for people to write the same stuff in both Title and Caption fields of the Media Library, I went ahead and added a check so the plugin uses only Caption if they’re textually identical.

    Ie: 1.2.1 will compare texts but still use the caption’s HTML. (see the post above yours for an example of why that’s important)

    The repo will update within 15 minutes.

    Will settings be available soon? I have just redone my site using nextgen and WP jquery lightbox, and basically I am happy. However I would like the option to change the color of the frames as well as the size (very small for my gallery). I would also like the option to have the image name or ‘alt’ text displayed along with the image number.
    (Note this is not being used in my blog posts, just my portfolio galleries). Thanks.

    Sure. Email me for a quote. (ulf at ulfben dot com)

    That doesn’t seem a helpful response. Why is there a settings link if it won’t open?

    You made a bunch of feature requests, but now changed it to a bug report.

    The Settings panel works on all of my installations. Perhaps this can help you: http://wordpress.org/support/topic/plugin-wp-jquery-lightbox-is-there-a-way-to-set-any-options?replies=3

    I am using this script and the captions are not displaying.
    I have check that i have all the right requirements.

    The site I am refering to is:

    http://japansnowreports.com/image-gallery/

    Just click on any of the thumbnails and it with fire the lightbox function.

    Could you please give me some feedback as to what might be going wrong.

    Toolbox Designs.

    Hi

    Great plugin, thanks. I’ve started using a CDN while also combines files and I’m getting a JS error for this plugin: “d.prototype is undefined”.

    I’m clueless about code so I haven’t the vaguest idea what to fix.

    Hi all,
    It seems that in the last version I’ve found a bug. If you use a dash in image title name and copy exactly same text to legend, the comparaison failed for equality between this two values. The “-” is transformed into HTML entities “$dash;” for one value of both.
    So I see 2 times same text in image lightbox, title an caption, with the “&dash” in caption.

    Can you reproduce this ?
    big thx anyway for this plugin !

    Great plugin!

    I have used it in a client site (still in the preliminary stages…) but what I am noticing is that when I click on a thumbnail and the lightbox loads, you can see the navigation bar of the site through the lightbox.

    Please take a look at this:
    http://www.vesselds.com/testwp/portfolio

    *Click on a thumbnail without scrolling down and you will see the navigation bar through the pop up.

    I really need to get this resolved asap and have been looking high and low all over the web for a solution, but have unfortunately not been able to find any help.

    Hopefully you can shed some light.
    *Fingers crossed.

    Thanks!

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘[Plugin: WP jQuery Lightbox] Title-captions Bug found, solved, and fix proposed’ is closed to new replies.