Warning: ob_start(): non-static method wpGoogleAnalytics::get_links() should not be called statically in /home/content/07/5480207/html/seosumocom/wp-content/plugins/wp-google-analytics/wp-google-analytics.php on line 259
How to get multi-line titles in Michael Jackson’s Shadowbox.js | SEOSUMO.COM | SEO Sumo is a Miami SEO, Design and Wordpress Customization Agency

I’ve been looking for an answer to this question at Shadowbox’s forums, and haven’t found a working solution. Despite I though the answer was to stop requesting to Michael Jackson to change the way a title works but waiting until someone adds a description or caption feature to it, I couldn’t resist myself on doing it!

Here’s an image of the compared files for you to see what you have to change on the shadowbox.js file.

shadowbox.js  for multi-line titles support

And for the css, just make these rules look like this
Shadowbox.css for multi-line titles support

Of course there could be more elegant solutions, but I got dizzy when trying to track all the places where the sizes are changed. I wanted to convert the height of the title text block from the initial ‘auto’ to a pixel size so Shadowbox can use it in the normal functions, but there were paddings and other values animated… too much for a night, and for a script I didn’t create.

Finally, the -100px initial position for the title’s “appearing” motion I got hours ago (which I ignored to go for a dynamic one) made the trick. The motion is so fast that you couldn’t see the difference.

You can see it working at http://www.lpmediafilms.com/index2.php


  1. by thomas
    July 25, 2009
    4:31 pm

    Have you been able to duplicate this solution on WP 2.8.2 and Shadowbox 3? I’m actually trying to get the caption field to show, rather than the title field…

    No luck so far.

  2. by sergio
    August 1, 2009
    6:02 am

  3. by MRB
    September 11, 2009
    7:04 am

    I tried your solution on my slideshow
    a) The first slide had no caption nor any controls below the image.
    b) while for the rest of the slides.. its working for only upto 2 lines of Title.. I usually have 3-4 lines in the Title.

    so I did a very straightforward..
    #sb-title { height:100px !important; }
    on my local page and leave the rest of the originals as it is. I dont mind the extra space between the images and title.

  4. by ede
    February 1, 2010
    1:21 am

    Could you please repost the image of the shadowbox.js code? Thanks!

  5. by Lavern
    June 3, 2010
    3:20 pm

    I have SB 3.0.3 installed on static pages and the code is different from what you show in your example. Do you know how to customize the latest version to show multiple lines of text in the caption?

    Thank you,

RSS feed for comments on this post. TrackBack URL

Leave a comment