Results 1 to 4 of 4

Thread: MAKE A ZOOm IN AND ZOOM OUT WITH BUTTON

  1. #1
    Sencha User
    Join Date
    Feb 2012
    Location
    Madagascar
    Posts
    24
    Vote Rating
    0
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    You would have to scale the image
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Feb 2012
    Location
    Madagascar
    Posts
    24
    Vote Rating
    0
      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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Answers
    3931
    Vote Rating
    1272
      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 @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

Posting Permissions

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