My captions won't display!

Page: 1

Author Post
Alex
Guest
Hello from Brazil, and thank you for this great tool!

Everything else seems to be in order, except when I try to display captions. I followed the instructions, which are clear. But neither setting a 'title', nor a 'caption' attribute on the <a> element (within the href string or otherwise) seemed to work.

My options at floatbox.js are set as default (showCaption: true).

Any ideas?
Administrator
Registered: Aug 2008
Posts: 3382
Picking up the caption from the title attribute or from the caption option in the rev attribute is a reliable thing, so you must have your syntax wrong in some way. When you use the phrase "within the href string" it makes me think this is certainly true. The caption has nothing to do with the href string.

Have a read of the captions section of the docs (http://floatboxjs.com/#captions) and follow the examples given there. If still no joy, please quote one of your anchor elements that isn't working for you so I can see why.
Alex
Guest
Hello and thank you so much for your reply!

OK, I created a test page, http://enxaqueca.com.br/floatbox.html

This is the syntax for the page's image:

<a href="http://www.enxaqueca.com.br/images/AdEnxaquecaSmall.jpg" rel="floatbox" title="This is a Test" rev="caption:'this is a test'"><img src="http://www.enxaqueca.com.br/images/AdEnxaquecaSmall.jpg" /></a>
Administrator
Registered: Aug 2008
Posts: 3382
Ah. You're using single quotes around the caption instead of back-quote characters. Instead of rev="caption:'this is a test'" you should say rev="caption:`this is a test`".

(The back-quote character is up in the top left of the keyboard together with the ~ char.)
Alex
Guest
So sorry, how stupid of me!

But although I have put the back-quotes in place, I am still not getting the caption! Might there be anything else wrong?

Here is what I've uploaded now, to the page http://enxaqueca.com.br/floatbox.html:

<a href="http://www.enxaqueca.com.br/images/AdEnxaquecaSmall.jpg" rel="floatbox" title="This is a Test" rev="caption:`this is a test`"><img src="http://www.enxaqueca.com.br/images/AdEnxaquecaSmall.jpg" /></a>
Administrator
Registered: Aug 2008
Posts: 3382
Ah again.
In this case, the displayed image is just too narrow to cleanly display the caption, so the caption is dropped. The floatbox code requires 80 pixels to be available for the caption in order to display it. The width of the close button is 46px and there's some space around that button.

I notice your close button is not displaying either. This is because the general public does not have read permissions on your /floatbox/graphics/ folder. (I'd check the languages folder too.)
Alex
Guest
Everything is working wonderfully now!

Thank you so much for your kind support. Hopefully this info will be useful to other users in the future, as well.

Page: 1