After upgrading fancybox to 2.1 the images get a default of 100px height

半腔热情 提交于 2019-12-25 03:04:17

问题


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
        }
    });

回答1:


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



来源:https://stackoverflow.com/questions/12258357/after-upgrading-fancybox-to-2-1-the-images-get-a-default-of-100px-height

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!