Results 1 to 5 of 5

Thread: How to scale images or containers to different device size (width and hieght)

  1. #1
    Sencha User
    Join Date
    Aug 2012
    Posts
    40
    Answers
    1
    Vote Rating
    5
      0  

    Default Unanswered: How to scale images or containers to different device size (width and hieght)

    Hello,

    I am wanting to scale my Images or my containers, so when the device get bigger the images or containers get bigger, without having to change it manually. Pretty much doing what a device profile does to exact, just in a different way. I was thinking of using CSS something like this below but it doesn't work...
    Code:
    @media all and (max-width: 320px) {
     .x-img {
        max-width  : 80%;
        height : auto;
     }
    }
    Your help is very much appreciated in advance if you wouldn't mind helping me out...

  2. #2
    Sencha User sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,335
    Answers
    124
    Vote Rating
    91
      0  

    Default

    HI!

    check out the following tutorial, it will helps you in your scenario,
    http://www.sencha.com/learn/how-to-use-src-sencha-io/
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

  3. #3
    Sencha User
    Join Date
    Aug 2012
    Posts
    40
    Answers
    1
    Vote Rating
    5
      0  

    Default

    No that didn't help all that shows is how to resize an image not resizing the image with the device

  4. #4
    Touch Premium Member BostonMerlin's Avatar
    Join Date
    Aug 2010
    Location
    Boston
    Posts
    548
    Answers
    22
    Vote Rating
    44
      0  

    Default

    add mode: 'element' to your images config.

    as long as your container is resizing along with your device size, the image inside that container (if also bound to the size of it's parent) will resize as well.

  5. #5
    Sencha User
    Join Date
    Aug 2012
    Posts
    40
    Answers
    1
    Vote Rating
    5
      0  

    Default

    Okay, is there any way to do it with css?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •