I am using fancybox 2. I have manage to load content in fancybox via AJAX. But it loads the whole page and I am only interested in specific div. In fancybox 1 we could do that by adding filter in ajax. But I am not sure how to filter in fancybox 2.
How to filter specific div from AJAX loaded page in fancybox 2?
$(".fancybox").fancybox({
maxWidth : 800,
maxHeight : 600,
fitToView : false,
width : '70%',
height : '70%',
autoSize : false,
closeClick : false,
openEffect : 'none',
closeEffect : 'none',
type : 'ajax',
'ajax' : {
dataFilter: function(data) {
return $(data).find('#modalArticleContainer')[0];
}
});
Untile ajax it works but loads whole page, when I add filter then it stops working. This is how I did previously in fancybox 1.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…