将fancybox升级到2.1后,图像的默认高度为100px [英] After upgrading fancybox to 2.1 the images get a default of 100px height

查看:86
本文介绍了将fancybox升级到2.1后,图像的默认高度为100px的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所有图像的高度均为100像素,屏幕顶部的自动宽度为非居中位置(图像大于100像素).当我今天升级到2.1最新版本时,发生了这种情况.这是最新版本中的错误吗?

使用调整大小"按钮时,尺寸似乎是正确的-但仍不能垂直居中.

    $("a[href*='.jpeg'], a[href*='.jpg'], a[href*='.png'], a[href*='.gif']").attr("rel", "imagegroup").fancybox({
        prevEffect: 'elastic',
        nextEffect: 'elastic',
        helpers: {
            title: null,
            overlay: {
                opacity: 0.8,
                css: {
                    'background-color': '#000'
                }
            },
            thumbs: { // remove if you do not want thumbnails at bottom
                width: 50,
                height: 50
            },
            buttons: {} // remove if you do not want buttons at top
        }
    });

解决方案

这不是错误.您可能已经升级了js文件,但忘了升级css文件.

带有fancybox css 文件v2.0.6(或更低)的

Fancybox js 文件v2.1.0将生成高度为100px并与窗口顶部对齐的图像.

查看演示

All images gets a 100px height, and auto width on top of screen - not centered (the images are higher than 100px). This happened when I upgraded to 2.1, latest version today. Is this a bug in the latest build?

The size seems to be correct when using the resize button - but still not centered vertically.

    $("a[href*='.jpeg'], a[href*='.jpg'], a[href*='.png'], a[href*='.gif']").attr("rel", "imagegroup").fancybox({
        prevEffect: 'elastic',
        nextEffect: 'elastic',
        helpers: {
            title: null,
            overlay: {
                opacity: 0.8,
                css: {
                    'background-color': '#000'
                }
            },
            thumbs: { // remove if you do not want thumbnails at bottom
                width: 50,
                height: 50
            },
            buttons: {} // remove if you do not want buttons at top
        }
    });

解决方案

It's not a bug. You may have upgraded the js files but forgot to upgrade the css files.

Fancybox js file v2.1.0 with fancybox css file v2.0.6 (or lower) will produce images 100px height and aligned to the top of the window.

SEE DEMO

这篇关于将fancybox升级到2.1后,图像的默认高度为100px的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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