Re: Title from Alt

37 views
Skip to first unread message
Message has been deleted

RavanH

unread,
Oct 27, 2010, 9:40:30 PM10/27/10
to fancybox

Looking for the same but I've had no luck trying 'titleFromAlt' : true
(and other possible variations) either :(




On 27 okt, 19:11, Sander <pasti...@gmail.com> wrote:
> Hi everyone,
>
> I searched the group/net looking for a way to get the fancybox caption
> (wich it gets from the title in the anchor tag). A few days ago i
> thought i've found the grail with the update to fancybox 1.3.2...
> First problem was that my fancybox styling looked like crap with the
> new update, second thing was the the titleFromAlt wasn't working
> eather...
>
> My goal is thus to remove the tooltips by getting the caption from the
> alt tag instead of the title tag.
> I tried out several other things includinghttp://groups.google.com/group/fancybox/browse_thread/thread/7f2777fc...
> but nothing works.
>
> Anyone an idea ?
>
> this is the websitehttp://snorgiomoroder.com/Beta/
>
> Help would be greatly appreciated,
> Thanks in advance
>
> Sandro

JFK

unread,
Oct 27, 2010, 9:49:40 PM10/27/10
to fancybox
v1.3.2 introduced a new option (not documented yet on the website):
titleFromAlt

Important notes to bear in mind:
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>

I will add this update to the post you referred
Reply all
Reply to author
Forward
0 new messages