If I understood right, you want fancybox title as a combination of the title
attribute in the a
tag + the alt
attribute in the img
tag.
If the above is correct, then having a html like
<a class="fancybox" href="images/01.jpg" title="title anchor 01" ><img src="images/01t.jpg" alt="alt image 01" /></a>
the fancybox title should say "title anchor 01 alt image 01"
you do that with this script:
$(document).ready(function() {
$(".fancybox").fancybox({
helpers : {
title: { type: 'inside'}
},
afterLoad: function(){
this.title = this.title + ' ' + $(this.element).find('img').attr('alt');
}
}); // fancybox
}); // ready
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…