jQuery addCaptions 0.2 – Minor update

I’ve been using the jQuery addCaptions plugin and have come across a couple of new features that I felt were required and have fixed a bug in the previous verison.

I have added an exclude option to the settings so you can prevent captions being added to elements not required (like a reCaptcha box…). It’s used like this:

This would exclude any images that have the word ‘orange’ in the the alt attribute.

I also fixed a minor bug in which the script would look for captions in elements in reverse order (whoops!).

The only other change is making the elements found within the container a selector instead of an element option and a class option.

There is an updated demo here, or you can just download the script here.

3 Replies to “jQuery addCaptions 0.2 – Minor update”

  1. Hi!

    Can addcaptions handle small images with long captions with “white-space:pre,”?

    Think of a stamp, they often need a long description.

    kind regards
    Sara

    1. Hi Sara,

      The styling for the captions is all handled manually, the script only applies markup and classes, so technically yeah it could, if you were to remove the width on the div.caption (or whatever the class you specified is) or set it to auto, and change the styles for the div.caption p.caption-title to include white-space: pre, that should do it for you!

      Hope that helps, let me know if you have any issues 🙂

      Dom

Leave a Reply

Your email address will not be published. Required fields are marked *