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
Asked
Active
Viewed 83 times
1 Answers
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')
});
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
-
in this scope it work. But insert it in 'Ext.toolbar.Toolbar' element is a more complicated task – Lokser Oct 22 '15 at 10:32
-
I don't think so. Updated the answer and fiddle. – Gilsha Oct 22 '15 at 11:15