如何在其他图像下设置图像?

时间:2015-10-22 07:24:20

标签: javascript extjs extjs6

如何在其他图像下设置图像。用户照片和半透明图片有两张图片,需要设置用户的照片。如何使用ExtJs

1 个答案:

答案 0 :(得分:1)

试试这种方式。

Ext.create('Ext.Img', {
  src: 'http://www.sencha.com/img/20110215-feat-html5.png',
  width: 184,
  height: 90,
  autoEl: {
    tag: 'div'
  },
  id: 'image1',
  renderTo: Ext.getBody()
});

Ext.create('Ext.Img', {
  src: 'http://orig01.deviantart.net/2890/f/2012/168/0/a/labyrinth_free_background_transparent_png_by_jacobmainland-d53tglc.png',
  width: 184,
  height: 90,
  style: 'position:absolute;left:0px;top:0px;',
  renderTo: Ext.get('image1')
});

Sencha Fiddle

编辑:

tbar: [{
  xtype: 'image',
  src: 'http://www.sencha.com/img/20110215-feat-html5.png',
  width: 184,
  height: 90,
  autoEl: {
    tag: 'div'
  },
  id: 'abc',
  listeners: {
    render: function() {
      Ext.create('Ext.Img', {
        src: 'http://orig01.deviantart.net/2890/f/2012/168/0/a/labyrinth_free_background_transparent_png_by_jacobmainland-d53tglc.png',
        width: 184,
        height: 90,
        style: 'position:absolute;left:0px;top:0px;',
        renderTo: Ext.get('abc')
      });
    }
  }
}],