PDA

View Full Version : Working with images



stenlik
30 Nov 2010, 5:51 AM
Hello,

what is the best way to put the image on the background of the Ext.Panel? i have used the 'cls' property and in CSS I have defined the class with "background-image". The problem is that I would like the image to be scaled to the panel size - is that possible somehow?

Other problem is the screen size and rotation. Is it possible to define different images for the different resolutions (iPhone3 vs. iPhone4 vs. iPad) and screen rotations (landscape and portrait)?

BR
STeN

mrsunshine
30 Nov 2010, 1:59 PM
you can do something like
.myclass {
background-image: url(white-rabbit.jpg);
background-repeat:no-repeat;
background-position:center center;
background-attachment:fixed;
-webkit-background-size: 100% 100%, auto;
background-size: 100% 100%, auto;
}

and change the cls property depending on the device


cls: Ext.is.Phone ? 'phoneclass' : 'tabletclass'