can someone help me properly add calc width with jquery? Or maybe theres a better option for dynamic width in jquery than applying css3 calc width?
var calc = "calc(100% - 270px)";
$(".two").focus(function () {
$('.one').animate({ width: "85px" });
$(this).animate({ "width": calc + "px" });
});
Let me know if you need more description. Thanks~
calcis a css property. You shouldn't docalc + "px"in your javascript, just leave it aswidth:calc. And I don't think it works withanimate, either.