如何使用Javascript设置动态字符串值? [英] How to set a dynamic string value using Javascript?

查看:104
本文介绍了如何使用Javascript设置动态字符串值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个代码,但因为我使用 a.innerheight 不会被其值替换。是否有可能使这个动态?

I have this code but since I use "" the a.innerheight does not get replaced by its value. Is it possible to make this dynamic?

a.style.webkitTransform = "translate(0,a.innerHeight)"


推荐答案

我不知道你要的是什么这可能吗?

I'm not sure what you're asking for... this maybe?

a.style.webkitTransform = "translate(0," + a.innerHeight + ")";

这篇关于如何使用Javascript设置动态字符串值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆