function Scale(){
X = innerWidth / 1024;
Y = innerHeight / 768;
Z = document.getElementById("IFM");
Z.style.transform = "scale(X, Y)";
}
I have a problem with this code. I couldn’t use variables in scale!
What can I do with this problem?
JavaScript has no inline string variables. All you can do is concatenate strings:
The numbers will be implicitly converted to strings.
You might as well use some custom
sprintf-like format- or replace-methods, but usually concatenation with+is simpler.