2 Replies Latest reply on Oct 31, 2013 4:01 AM by toma82

    SVG interactivity : problem of text compatibility

    toma82

      Hello everyone,

       

      I have an animation using some interacitve SVG. I used the Edge Commons example (http://www.youtube.com/watch?v=4UEB6gaLKuw) and it works well.

      But i have an issue regarding the text codage :

      I have "spaces" in the text of my layers in the SVG file, but the "spaces" are replaced with "underscore" in the animation.

      I guess it is a codage problem but i have no idea how to fix this. Should I look in the SVG export option of Illustrator ? Should i code something in the html file ? Is there a solution ?

       

      Thanks for the help !

        • 1. Re: SVG interactivity : problem of text compatibility
          resdesign Adobe Community Professional & MVP

          Below is the code I used to correct some problems with layer names. You can use 1 or 3 depending on what you need but from your question use number 1 and change last line accordingly.

          sym.setVariable("selectedPart", event.target);

          // REMOVE THE UNDERSCORE

                                                            var newText = (event.target.id).split("_").join(" ");

          // REMOVE NUMBER ONE IF DUPLICATE LAYER NAME

                                                            var newText2 = (newText).split("1").join("");

          // REMOVE UNECESSARY SPACE

                                                            var newText3 = (newText2).split(" ").join("");

           

          Then you could use this
          sym.$("selectedPartTxt").html( newText2 );

          • 2. Re: SVG interactivity : problem of text compatibility
            toma82 Level 1

            Thanks.

            It works just fine !