jQuery CSS scale转换不起作用

时间:2017-11-29 06:16:52

标签: javascript jquery html

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 个答案:

答案 0 :(得分:1)

$(".english_canvas.unit_11").css("transform","scale("+scale_width+","+scale_height+")");

答案 1 :(得分: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+")"})