1. #1
    Sencha User
    Join Date
    Feb 2012
    Location
    Madagascar
    Posts
    24
    Vote Rating
    0
    Fayt is on a distinguished road

      0  

    Default Unanswered: MAKE A ZOOm IN AND ZOOM OUT WITH BUTTON

    Unanswered: MAKE A ZOOm IN AND ZOOM OUT WITH BUTTON


    Hi,

    I want to make a zoom in and zoom out on my panel when I tap on a button + and - , here's my code to do the + action

    Code:
    sizeUp: function(){
        var scrwidth = Ext.getCmp('pan').getWidth( );
        var scrHeight = Ext.getCmp('pan').getHeight( );
        
        Ext.getCmp('pan').setHeight(   scrHeight + ( scrHeight/4));
        Ext.getCmp('pan').setWidth(   scrWidth + ( scrWidth/4));
    }
    As I expect, the panel size changes, but the elements like text, images, ..., doesn't change. I don't know what to do, I have no clue to proceed.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,525
    Vote Rating
    871
    Answers
    3564
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You would have to scale the image
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Feb 2012
    Location
    Madagascar
    Posts
    24
    Vote Rating
    0
    Fayt is on a distinguished road

      0  

    Default


    but the docs says that scale method can be only used for pinch event, and in my case I want to do this when I tap on the button

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,525
    Vote Rating
    871
    Answers
    3564
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Quote Originally Posted by Fayt View Post
    but the docs says that scale method can be only used for pinch event, and in my case I want to do this when I tap on the button
    CSS3 scale will increase the scale. EIther than or you can increase the font-size but if you have any images or anything scale is what you should use.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1