2 Replies Latest reply on Mar 11, 2013 12:41 PM by Rafael Carignato

    Changing .css property through external Javascript file?

    Rafael Carignato



      I'm trying to create all kinds of functions on an external .js file, so I can just call them in Edge multiple times with less coding. The thing is, after importing jQuery and my external Javascript file, some code works, but I get stuck at this part: changing the .css property of a symbol, more specifically, the "font-size" property. My current function is:


      function setFont(textid,fontsize,originalWinWidth){ //textid: symbol's name; fontsize: current font size of this symbol; originalWinWidth: window size at the start of the animation

      console.log("Set Font:");

      //set the original font size

      var originalFontSize = Math.round(originalWinWidth/fontsize);

      console.log("Original Font Size: " + originalFontSize);

      console.log("Text ID: " + textid);

      //set the font size using jquery

      sym.$(textid).css("font-size", originalFontSize);  }



      I get an error at the last line, all other parts of the code works. Any idea what this could be?



      Rafael Carignato