JS中动态调整Class、Style
作者:
第一梯队利群 | 来源:发表于
2019-03-08 13:50 被阅读0次setBackHeight() {
var backHeight = document.getElementById("serviceCommentClass");
var heightStr =
this.backHeight + this.myLawyer.lawyerEvaluatels.length + "rem";
console.log("heightStr:", heightStr);
//第一种:设置某个具体的值
backHeight.style.height = heightStr;
//第二种:用cssText
div.style.cssText='width:600px;height:250px;border:1px red solid;text-align: center;line-height: 250px;';
}
本文标题:JS中动态调整Class、Style
本文链接:https://www.haomeiwen.com/subject/fcdrpqtx.html
网友评论