当前位置: 动力学知识库 > 问答 > 编程问答 >

jquery - Can Fancybox be responsive only horizontally for tall content?

问题描述:

I have a site with some very tall images. I'd like for these images to respond in a responsive way horizontally, but not vertically. If they conform to the height of the browser, they become too small to see properly.

Is there a simple way to accomplish this that I'm missing?

See an example below. Click on the second thumbnail "bswift", then a small grey square to launch Fancybox.

http://www.eaaronrossdesign.com/index2.php

网友答案:

Try combining the fitToView and maxWidth API options like :

$('.thumbs_small').fancybox({
    openEffect: 'elastic',
    closeEffect: 'elastic',
    prevEffect: 'fade',
    nextEffect: 'fade',
    fitToView: false, // images won't be scaled to fit to browser's height
    maxWidth: "90%" // images won't exceed the browser's width
});

Check JSFIDDLE

分享给朋友:
您可能感兴趣的文章:
随机阅读: