fancyBox3触发iframe
在旧的fancyboxversion中,我使用此代码打开iframe
$.fancybox({ 'padding': 20, 'width': '650px', 'type': 'iframe', 'href': '....php?anchor=' + xyz, 'autoDimensions': true, 'autoScale': true, 'centerOnScroll': true, 'scrolling' : 'no', afterClose : function(){ location.reload(); } });
在新版本中是不可能的。 有任何想法吗?
只需看一下docs / API。 它会是这样的:
$.fancybox.open({ src : 'https://codepen.io/', type : 'iframe', opts : { iframe : { css : { width: '500px' }, attr : { scrolling : 'no' } }, afterClose : function() { alert('done!'); } } });