views:

93

answers:

1

I installed a pop-up slideshow gallery using FancyBox /example), which lets you add a caption under the pop-up image, using the title tag.

Unfortunately, when you hover over the thumbnail, the title tag shows up with all the styled code in it, which looks pretty bad.

Is there a way to disable the title hover, without disabling the actual styling itself?

+3  A: 

If there'sa title attribute on the tag, when you hover the mouse over it, browsers supporting the title attribute will show it as a tooltip. I'm not aware of any way to modify that behavior.

You could modify FancyBox (and perhaps even offer a patch, supporting the project) to deal with the problem. You can't be the only user running into it. I can think of three ways:

  1. Use a different attribute, for instance data-caption, for the markup-enabled caption, and use title only if that's not there. (Recommending to users that they not put markup in title.) (That naming convention, data-xyz, is officially approved now in HTML5 for custom attributes.)
  2. Remove the title attribute after using it to create the caption. (Blech)
  3. Pre-process the title attribute after using it to create the caption, removing all markup. (Also blech)

I'd go with #1.

T.J. Crowder