使fancybox缩小图像,而不是裁剪图像

时间:2014-11-18 16:17:36

标签: jquery html css wordpress fancybox

我有一个基本的Wordpress网站,帖子显示在首页上。当您点击帖子时会显示一个fancybox模式,这会使用single.php模板显示帖子。这只会显示完整尺寸的后缩略图,也可能是描述。

除了仅扩展到600px宽的fancybox之外,它都有效。我无法找到这个600号码的来源,据我所知,我应该将其缩小到适合屏幕的范围。

一些选项包括:

        width     : 1000,
        height    : 600,
        minWidth  : 100,
        minHeight : 100,
        maxWidth  : 1000,
        maxHeight : 9999,
        pixelRatio: 1, // Set to 2 for retina display support

        autoSize   : true,
        autoHeight : true,
        autoWidth  : true,

        autoResize  : true,
        autoCenter  : !isTouch,
        fitToView   : true,
        aspectRatio : false,
        topRatio    : 0.5,
        leftRatio   : 0.5,

        scrolling : 'no', // 'auto', 'yes' or 'no'
        wrapCSS   : '',

        arrows     : true,
        closeBtn   : true,

...但我似乎尝试了这些的每一种组合,但效果很小或没有效果。

有谁知道这600来自哪里或者为什么要恢复到那个尺寸?

这是网站... http://www.marcoshype.com/

这是一个将在模态http://www.marcoshype.com/photography/no-faking/

中的帖子的示例

感谢您提前提供任何帮助

1 个答案:

答案 0 :(得分:0)

您网页的第113-129行来源:

$(document).ready(function() {

    $("a.fancybox").fancybox({
        'width'              :  600, 
        'height'             :  800,
        'overlayOpacity'     :  '0.4',
        'overlayColor'       :  '#000',
        'hideOnContentClick' :   false,
        'autoScale'          :   false,
        'transitionIn'       :   'elastic',
        'transitionOut'  :   'elastic',
        'type'           :   'iframe'
    });

    $(".grid_9").find("a").fancybox();

  });