Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8813287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:48:39+00:00 2026-06-14T03:48:39+00:00

I have implemented a caption solution for shadowbox which uses the ‘rev’ inline tag.

  • 0

I have implemented a caption solution for shadowbox which uses the ‘rev’ inline tag.

In shadowbox.js add…

...get("sb-caption").innerHTML=obj.link.rev||"";... 
...<div id="sb-caption"></div>...

In shadowbox.css add the following to the bottom of the file…

#sb-info,#sb-info-inner{height:56px;line-height:20px;} 
#sb-caption {clear:both;font-size:90%;height:auto;line-height:12px;color:#fff;} 

In your page markup add the rev attribute (yes, it’s a valid attribute like rel!) to the link…the caption text goes into the rev attribute…

<a href="myimage.jpg" rel="shadowbox" title="My Image" rev="Your caption goes here...">My Image</a> 

That’s it…enjoy!

Explained more here: http://shadowbox.1309102.n2.nabble.com/Captions-td2643307.html

This was a very easy thing to implement.

However, I created my own CSS…

#sb-caption{text-align:right;line-height:22px;color:#333;position:absolute;bottom:35px;right:35px;background:rgba(255,255,255,0.3);text-shadow: 1px 1px 1px #fff;display:block; padding:10px 20px 10px 50px;z-index:10;}

This all worked wonderfully as well, however, I have spotted a problem.

When an image does NOT have a rev, the #sb-caption div appears anyway, as a semi-transparent white block, 20×70 pixels in size (the same as the padding)
I understand that my padding set-up is the cause of the problem.

I’m wondering if anyone can help me with a work-around.
Something that tells shadowbox to NOT DISPLAY #sb-caption, if the rev=”” is NOT SPECIFIED.

Can anyone come up with a fix for this.

Something along these lines maybe??

<script type="text/javascript">
  Shadowbox.init({
  });
  var Shadowbox = window.parent.Shadowbox;
  if (getElementById('sb-caption').innerHTML == '')
  getElementById('sb-caption').style.display = 'none';
</script>

…But, that doesn’t work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T03:48:40+00:00Added an answer on June 14, 2026 at 3:48 am

    you were close, but you can handle this directly in the shadowbox.js (if you’re changing it anyway). Insert this

    ad("sb-caption").style.display = (ad("sb-caption").innerHTML == "") ? 'none' : 'block' ;
    

    right after

    ad("sb-caption").innerHTML=aJ.link.rev||"";
    

    and you’re done.
    I think it’s obvious what it does: Everytime you open a Shadowbox, you check for content within the id=”sb-caption” element. If there is no content set its display to none, otherwise to block.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this chunk of code which I found and implemented according to http://www.activexperts.com/activmonitor/windowsmanagement/scripts/networking/windowsfirewall/
i have implemented galleryview in one screen named display_image.xml in which i have shown
Have implemented the Sitecore (6.5 rev.120427) calendar module (2.4.0 rev.110602) on our staff intranet.
I have implemented a recursive function on image which call its neighbor pixels until
I have implemented exactly the code which is shown on this page: http://developers.facebook.com/docs/reference/dialogs/feed/ Problem:
I have implemented web service using rails server. The server uses rails default authentication
I am working on a project in which i have implemented Friends invitation using
I have implemented inline editing with Knedo UI MVC grid with Ajax binding, Server
I have implemented correctly bump's api, and added this code: - (void) configureBump {
I have implemented pagination to my data, but the problem is I only have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.