0

How to set image under other image. There are two pictures user's photo and semi transparent picture which need to set over user's photo. How to do it with ExtJs

Tarabass
  • 3,132
  • 2
  • 17
  • 35
Lokser
  • 17
  • 10

1 Answers1

1

Try this way.

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

EDIT:

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')
      });
    }
  }
}],
Gilsha
  • 14,431
  • 3
  • 32
  • 47