
[英]How to get the css value of transform directly using jquery that witch set as percent
[英]Set transform value by jQuery
我想设置值:
translate(-50%, -50%) translate(-100px, -300px);
转换div标签的CSS属性。
我使用下一条命令:
jQuery('.content').css('transform', 'translate(-50%, -50%) translate(-100px, -300px);');
但是我什么也没改变。 我该如何设置?
在jQuery代码中有一个分号;
在translate(-50%, -50%) translate(-100px, -300px);
这会阻止jQuery使用代码。 删除它,它将起作用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.