问题
In a old fancyboxversion i open a iframe with this code
$.fancybox({
'padding': 20,
'width': '650px',
'type': 'iframe',
'href': '....php?anchor=' + xyz,
'autoDimensions': true,
'autoScale': true,
'centerOnScroll': true,
'scrolling' : 'no',
afterClose : function(){
location.reload();
}
});
in a new version is it not possible. Any ideas?
回答1:
Just take a look at docs/API. It would be like this:
$.fancybox.open({
src : 'https://codepen.io/',
type : 'iframe',
opts : {
iframe : {
css : {
width: '500px'
},
attr : {
scrolling : 'no'
}
},
afterClose : function() {
alert('done!');
}
}
});
Demo - https://codepen.io/anon/pen/BmbmJX?editors=1010
来源:https://stackoverflow.com/questions/47637766/fancybox3-trigger-an-iframe