I have an issue triggering afterClose fancybox 2.1.4 event.
I have an init script like this
$.fancybox({
maxWidth : 900,
maxHeight : 600,
fitToView : false,
width : '70%',
height : '70%',
autoSize : false,
closeClick : false,
openEffect : 'none',
closeEffect : 'none',
afterClose : function() {
alert('Hi!');
return;
}
});
I have a DIV that triggers a function that fills a DIV with HTML data
<div onclick="projectDetail('+project.id+')">View Details</div>
The trigger function that fills in the fancybox content DIV is this
function proyectDetail(id) {
var project = $('#project');
var result = '<h2>Lorem ipsum dolor sit amet</h2>\
<p>\
Lorem ipsum dolor sit amet, consectetur adipiscing elit.\
</p>';
project.append(result);
$.fancybox(project);
}
The issue is that the afterClose event doesn't gets fired!
I need just to click that div, open fancybox and clear contents after fancybox close, because, the popup may be filled with different data, depending on given project id.
Thanks in advise!
projectin fancybox, of course it will never triggerafterClosebecause you haven't set any. - JFK