我使用的是版本2,我想用更新的版本更新。
大多数情况下,我使用它通过调用PHP页面在我的窗口中打开一个窗口。
请在下面找到我的JS函数来调用一个花哨的box 2:
function fancybox(url, modal, width, height, parameters, title, refresh) {
$.fancybox({
width: width,
height: height,
fitToView: false,
autoSize: true,
autoScale: false,
transitionIn: 'none',
transitionOut: 'none',
type: 'iframe',
beforeClose: function() {
if (refresh !== undefined) {
eval(refresh);
}
},
href: url + '?' + parameters,
modal: modal,
title: title,
helpers: {
title: {
position: 'top',
type: 'inside'
}
}
});现在我的调用JS有了这个函数:
fancybox('annonce-detail.php', false, 200, 200, 'nunati=' + 0504+ '&copaip=' + 0454+ '&objet=' + objet, undefined, 'refresh()');今天,我想让它进化到能够适应这个新版本。问题是我不能用新版本做这样的新功能。请在下面找到我的研究开始:
$.fancybox.open({
iframe : {
tpl :url + '?' + parameters,
css : {
width: width,
height: height
}
}
});我甚至不能用php页面打开一个fancybox
你能告诉我我的请求是否可行吗?也许我需要你的一些帮助。
先谢谢你,
发布于 2017-11-07 16:16:15
您只需查看文档- http://fancyapps.com/fancybox/3/docs/#api -并遵循新的语法:
$.fancybox.open({
src : 'YOUR LINK',
type : 'iframe',
opts : {
iframe : {
css : {
width : WIDTH,
height : HEIGHT,
}
},
beforeClose : function( instance, current ) {
console.info( 'closing!' );
}
}
});顺便说一句,请不要在GitHub问题上重复,在这里
https://stackoverflow.com/questions/47152335
复制相似问题