I'm trying to get the "alt" property text on a image to display as title when using fancybox
HTML
<a href='inlinePicture'........
<img alt='Awesome text'......
</a
JQUERY
$('.inlinePicture').facybox({
title: $(this).find('img').attr('alt')
});
Problem is that the title is displaying "$(this).find('img').attr('alt')" instead of "Awesome text", what em I doing wrong?
I've also tried :
$('.inlinePicture').facybox({
titleFormat: function (title) {
return $(this.orig).siblings('p').text() || title;
}