Hi all, what I'm trying to do is get the ID value of the referring a. The code for my a looks like:
<a class="photoBig" id="<?php echo $photo['id'] ?>" href="<?php echo $f->buildPhotoURL($photo, 'large') ?>" title="<?php echo $photo['title'] ?>">
I'm using phpFlickr to assign the ID's plus some various other things, which works fine.
So the code to open a Fancybox I use is:
$("a.photoBig").attr('rel', 'gallery').fancybox({
'titleShow' : true,
'overlayOpacity' : 0.9,
'overlayColor' : '#000',
'autoScale' : false,
'scrolling' : true,
'titlePosition' : 'inside',
'showNavArrows' : true,
'cyclic' : true,
'showCloseButton' : false,
'titleFormat' : formatTitle
});
then the function fomatTitle, which is:
function formatTitle(title, id, currentArray, currentIndex, currentOpts) {
return '<div id="photoBig-title"><span><a href="javascript:;" onclick="$.fancybox.close();"><img src="images/site/closelabel.gif"></a></span>' + (title && title.length ? '<strong>' + title + '</strong>' : '' ) + $(this).id + '<a href="http://www.flickr.com/photos/rustybones/' + this.id + '" title="view original on flickr">view full size</a></div>';
}
Everything works in this function except for this.id. Obviously I'm doing this wrong, so any help would be tops! Thank you.