October 27th, 2010
Back in April 2010 I published an explanation about how title works in
fancybox in a normal scenario:
http://groups.google.com/group/fancybox/browse_thread/thread/7f2777fca8335aa4/
v1.3.2 introduced a new option (not documented yet on the website as
today):
titleFromAlt
How to use this function:
1). if you are using thumbnails, then the alt attribute (that you want
to use as title) MUST be on the <img> tag (the thumbnail) like:
<a class="fancyimage" href="image.jpg"><img src="thumbnail" alt="my
alt as title" /></a>
2). if you are using a text link, then the alt attribute should be in
the <a> tag (this is not semantically correct -arguably- but we are
not trying to be purist, are we?) like:
<a class="fancyimage" href="image.jpg" alt="my alt as title">open
image</a>
3). In EITHER case, the option titleFromAlt has to be set to true,
like:
<script type="text/javascript">
$(document).ready(function() {
$("a.fancyimage").fancybox({
'titleFromAlt':true
});
});
</script>