【问题标题】:Show image within window panel in extjs在 extjs 的窗口面板中显示图像
【发布时间】:2014-06-28 22:25:23
【问题描述】:

我有一个固定宽度和高度(例如 500、400)的窗口面板,其中将显示图像。图像的宽度/高度为 200/700。如果它的宽度小于父容器,我必须在窗口内设置该图像而不违反其宽度。但问题在于图像的高度。图像的下部被截断。我使用了布局:适合。但是图像覆盖了窗口的整个宽度/高度,违反了图像的原始宽度。

任何帮助将不胜感激...

这里是代码...

Ext.onReady(function(){ var mapwin;

mapwin = Ext.create('Ext.window.Window', {
    title: 'Crop Window',
    width:500,
    height:400,
    border: false,
    x: 150,
    y: 60,
    items: 
    {
        xtype: 'image',
        width: 200,
        height: 400,
        src: 'path/to/any/image/200x700'
    }
});
mapwin.show();

});

【问题讨论】:

  • 请出示您的代码!!

标签: extjs


【解决方案1】:

为您的图片添加 css,尝试使用以下 css

.image {
position: relative;
height: auto;
min-height: 100% !important;
}

不要使用布局:适合

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多