You need to get the child iframe to talk to the parent window when the accordion is toggled.
$yourAccordion.on('open', function(e){
if(window.top && window.top.resizeDialog)
window.top.resizeDialog($(window).width(),$(window).height());
});
Then in your parent page, have a global function called resizeDialog
window.resizeDialog = function(w,h){
$('#dialog').find('iframe').attr({
width: w,
height: h
});
};
Note: You'll most likely need to account for animation timing etc. You could also include this in the step
function of the jQuery animate
method you use to open/close the accordion to make it a bit smoother.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…