OK, I figured out this and here is solution.... more like hack... but it works on all browsers... And what this does: it actually MASKS (doesn't remove it -> because I need to pass callbacks to it) first iframe (removing shadows, content even close button) and after close event - it restores the first iframe :)
Oh, there is additional "post message" stuff since whole site is actually loaded via iframe (cross-domain stuff) and this is solution that works in regular iframe which loads fancybox1 that loads fancybox2 with popup... anyway it's too complicated to explain, and anybody who seeks for viable solution - here you go:
$('.addmember').fancybox({
openEffect : 'elastic',
closeEffect : 'elastic',
fitToView : false,
nextSpeed: 0, //important
prevSpeed: 0, //important
beforeShow: function(){
$_returnvalue = false;
this.width = ($('.fancybox-iframe').contents().find('#popup-add-member').width());
this.height = ($('.fancybox-iframe').contents().find('#popup-add-member').height());
var ifrchild = $('.fancybox-iframe').contents().find('#popup-add-member').height()+60;
parent.$('.fancybox-skin').attr('style', function(i,s) { return s + 'height: '+ifrchild+'px;' });
parent.$('.fancybox-inner').attr('style', function(i,s) { return s + 'height: '+ifrchild+'px;' });
$('.fancybox-wrap').attr('style', 'top: 15px !important;');
parent.$('.fancybox-close').addClass("fancynodisplay");
parent.$('.fancybox-overlay').addClass("fancybox-hidescroll");
$('.fancybox-overlay').addClass("fancybox-hideoverlay");
$('.fancybox-overlay').addClass("fancybox-hidescroll");
$('.fancybox-skin').addClass("fancybox-hideshadow");
parent.$('.fancybox-skin').addClass("fancybox-hideshadow");
parent.$('.fancybox-skin').addClass("fancybox-hideskin");
$('#hide-on-open').attr('style', 'display:none;');
},
afterShow: function(){
},
afterClose : function() {
$('#hide-on-open').attr('style', 'display:block;');
var ifrmain = $('#schedule-members').height();
parent.$('.fancybox-skin').attr('style', function(i,s) { return s + 'height: '+ifrmain+'px;' });
parent.$('.fancybox-inner').attr('style', function(i,s) { return s + 'height: '+ifrmain+'px;' });
parent.$('.fancybox-close').removeClass("fancynodisplay");
parent.$('.fancybox-overlay').removeClass("fancybox-hidescroll");
$('.fancybox-overlay').removeClass("fancybox-hidescroll");
parent.$('.fancybox-skin').removeClass("fancybox-hideskin");
if ($_returnvalue != false && $_returnvalue.response == "OK" )
{
// MY CALLBACK FUNCTIONS
}
window.top.postMessage($('#wrap').height()+80, 'myiframe');
},
onUpdate : { autoHeight: true},
beforeLoad : function() {
var ifrchild = $('.fancybox-iframe').contents().find('#popup-add-member').height()+60;
window.top.postMessage(ifrchild, 'myiframe');
},
helpers : {
overlay : {closeClick: false}
}
});
And CSS to make this happen:
.fancybox-close.fancynodisplay {
height: 0px !important;
width: 0px !important;
display: none !important;}
.fancybox-overlay.fancybox-hidescroll {
overflow: hidden !important;
}
.fancybox-opened .fancybox-skin.fancybox-hideshadow {
-webkit-box-shadow: none !important;
-moz-box-shadow: none !important;
box-shadow:none !important;}
.fancybox-hideskin {
background: none repeat scroll 0 0 rgba(255, 255, 255, 0) !important;
position: relative !important;
text-shadow: none !important;
}
.fancybox-hideoverlay {
background: none;
}
afterShow: function(){parent.$.fancybox.update()}- JFK