0

jQuery:

var scale_width = 1;
var scale_height = 1.5;
$(".english_canvas.unit_11").css("transform","scale('"+scale_width+"','"+scale_height+"')");

HTML:

<div style="width: 210px; height: 210px; background-color: #fff" class="english_canvas unit_11"></div>
2
  • "scale(" + scale_width+", " + scale_height+")" is enough. Don't enclose scale values in ''. Commented Nov 29, 2017 at 6:19
  • $(".english_canvas.unit_11").css("transform","scale("+scale_width+","+scale_height+")"); Commented Nov 29, 2017 at 7:23

2 Answers 2

2
$(".english_canvas.unit_11").css("transform","scale("+scale_width+","+scale_height+")");
Sign up to request clarification or add additional context in comments.

Comments

0
<div style="width: 210px; height: 210px; background-color: #000" class="english_canvas unit_11"></div>


var scale_width = 1;
var scale_height = 3.5;
$(".english_canvas.unit_11").css({
  "-webkit-transform":"scale("+scale_width+","+scale_height+")"})

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.