alter prettyphoto to pull from div or span, not title
Posted
by Jason
on Stack Overflow
See other posts from Stack Overflow
or by Jason
Published on 2010-06-13T16:34:03Z
Indexed on
2010/06/13
16:42 UTC
Read the original article
Hit count: 207
Here's the section of code from prettyphoto.js that I need to alter. What I am trying to achieve is have each photo have a following hidden div or span that holds the description for the photo. This way I can include html in the description.
Possible?
Thanks!
var images = new Array(), titles = new Array(), descriptions = new Array();
if(theGallery){
$('a[rel*='+theGallery+']').each(function(i){
if($(this)[0] === $(_self)[0]) setPosition = i; // Get the position in the set
images.push($(this).attr('href'));
titles.push($(this).find('img').attr('alt'));
descriptions.push($(this).attr('title'));
});
}else{
images = $(this).attr('href');
titles = ($(this).find('img').attr('alt')) ? $(this).find('img').attr('alt') : '';
descriptions = ($(this).attr('title')) ? $(this).attr('title') : '';
}
$.prettyPhoto.open(images,titles,descriptions);
return false;
});
© Stack Overflow or respective owner