I have a problem with Magnific Popup where I need to set the height and width in an iframe using javascript function. The following code does not respond to the heights and widths I inserted, what is wrong?
openmagnificPopup(url, h, w);
function openmagnificPopup(url, h, w){
$.magnificPopup.open({
items: {
src: url,
type: 'iframe',
iframe: {
markup: '<div style="'+w+'px; height:'+h+'px;">'+
'<div class="mfp-iframe-scaler" >'+
'<div class="mfp-close">xxxxxx</div>'+
'<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>'+
'</div></div>'
}
}
});
.mfp-iframe-holder .mfp-content {
width:auto;
min-width:300px;
min-height:300px;
}
source
share