1 Reply Latest reply on Jun 5, 2013 10:38 AM by resdesign

    Is there a way to scale a symbol via code

    Marlene

      I want to scale a symbol to half its size through and action. Is this possible?

        • 1. Re: Is there a way to scale a symbol via code
          resdesign Adobe Community Professional & MVP

          Yes. Here is an example for shrinking a box:

           

          sym.$("Rectangle").css({

                    width: 300,

                    height: 100

          });

          sym.$("Rectangle").mouseover(function(){

          sym.$("Rectangle").css("-moz-transition", "width 2s");

          sym.$("Rectangle").css("width",10);

          });

          sym.$("Rectangle").mouseout(function(){

          sym.$("Rectangle").css("-moz-transition", "width 2s");

          sym.$("Rectangle").css("width",300);

          });

           

          You could use css for scaling with:

           

           

          transform: scale(2,4);

          -ms-transform: scale(2,4); /* IE 9 */

          -webkit-transform: scale(2,4); /* Safari and Chrome */

           

          For example on a click event scale the rectangle:

          sym.$('Rectangle').click(function(){

                    sym.$('Rectangle').css('transform', 'scale(2,4)');

          });