在覆盖区中调整媒体大小时,可以使fancyBox忽略标题文本吗? [英] Can you make fancyBox ignore title text when sizing media within an overlay?

查看:54
本文介绍了在覆盖区中调整媒体大小时,可以使fancyBox忽略标题文本吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用fancyBox 2.1.5,并在其下方显示具有多行标题的媒体.

I'm using fancyBox 2.1.5 and displaying media with multi-line titles below them.

我的问题是fancyBox似乎在缩小媒体,以适应屏幕上的长标题.下面是我最明显的iPhone截图.

My problem is that fancyBox seems to be shrinking media in an attempt to fit long titles on-screen. Below I've attached screenshots from my iPhone, where it is most obvious.

由于我已删除标题,因此此处以全尺寸显示图像:

Here the image is displayed at full size because I've removed the title:

此处图像被缩小,试图说明长标题:

Here the image is shrunken, trying to account for the long title:

我希望fancyBox在调整媒体大小时忽略标题文本,并始终以全尺寸显示它,如第一幅图所示.我可以滚动阅读所有标题文本.

I'd like fancyBox to ignore the title text when sizing media and always show it at full size, as seen in the first image. I'm OK with having to scroll to read all the title text.

感谢您的帮助!

推荐答案

如果您可以滚动阅读所有title文本,那么可以将fitToViewmaxWidth选项组合使用媒体大小以您想要的方式进行,而不会忽略title:

If you are OK with having to scroll to read all the title text, then you can combine the fitToView and maxWidth options to have the size of your media the way you want it without ignoring the title like :

$(".fancybox").fancybox({
    fitToView: false, // avoids media to shrink to fit in the viewport
    margin: [20, 60, 20, 60],
    maxWidth: "90%", // avoids bigger media to stretch outside the viewport boundaries 
    helpers: {
        title: {
            type: "inside"
        }
    }
});

请参见 JSFIDDLE

See JSFIDDLE

这篇关于在覆盖区中调整媒体大小时,可以使fancyBox忽略标题文本吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆