fancyBox3触发iframe [英] fancyBox3 trigger an iframe
本文介绍了fancyBox3触发iframe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在旧的fancyboxversion中,我使用此代码打开iframe
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?
推荐答案
只需看一下docs/API.就像这样:
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!');
}
}
});
演示- https://codepen.io/anon/pen/BmbmJX?editors = 1010
这篇关于fancyBox3触发iframe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文