Fancybox 1.3.4 JS 带有我的 Wordpress 主题 Gridlocked。一切正常,但灯箱弹出窗口对于屏幕来说太大了。如果需要始终适合屏幕,我希望图像缩小。
查看 Fancybox 站点说明,似乎我想在 PHP 或 JS 文件本身中设置“autoscale:true”来解决这个问题。主题附带的 javascript 文件已经将此设置为 true,但它不起作用。我不知道我应该尝试在所有主题 php 文件的哪个位置包含该参数。有什么建议么?
fancybox 的初始化在jquery.custom.js中完成。您可以在那里找到以下几行:
function tz_fancybox() {
if(jQuery().fancybox) {
jQuery("a.lightbox").fancybox({
'transitionIn' : 'fade',
'transitionOut' : 'fade',
'speedIn' : 300,
'speedOut' : 300,
'overlayShow' : true,
'autoScale' : false,
'titleShow' : false,
'margin' : 10,
});
}
}
tz_fancybox();
改成:
function tz_fancybox() {
if(jQuery().fancybox) {
jQuery("a.lightbox").fancybox({
'transitionIn' : 'fade',
'transitionOut' : 'fade',
'speedIn' : 300,
'speedOut' : 300,
'overlayShow' : true,
'autoScale' : true,
'titleShow' : false,
'margin' : 10,
});
}
}
tz_fancybox();