I have a listing of staff member that I want to have a link that pops up a bio via fancybox. I have no problem getting this to work using static id's, but when I try to do it dynamically via a custom field it doesn't seem to work.
Here is what I am doing:
<a class="staffLink" href="#" title="View {staff:staffName}'s bio">bio</a>
<script type="text/javascript">
$(document).ready(function() {
$(".staffLink").fancybox({
href : '#{staff:staffName} Bio',
maxWidth : 800,
maxHeight : 600,
fitToView : false,
width : '70%',
height : '70%',
autoSize : false,
closeClick : false,
openEffect : 'none',
closeEffect : 'none',
helpers : {
media : {},
title : null,
overlay: {
opacity: 0.9
} // overlay
}
});
});
</script>
<div style="display:none;" id="{staff:staffName} Bio">{staff:staffName} test content</div>
If I take out the custom field (staff:staffName) and just leave "Bio" for the id of the popup and in the the href of the Fancybox parameters it works. Also, If I look at the outputted code it populates correctly. The staff name is filled in for the href and the id.
Any ideas?