jquery - How do I integrate variable in strings (javascript) -


i trying this:

var newpositiononx = 400px;  $(".element").css("transform", "translate(0,newpositiononx)"); 

thank you!

try this:

var newpositiononx = 400; $(".element").css("transform", "translate(0, " + newpositiononx + "px)"); 

Comments

Popular posts from this blog

javascript - ScrollTo Effect (href to div) -

javascript - ng-class not responding to change in model in Angular? -

javascript - document.registerElement extending HTMLInputElement prototype while using custom tag name to avoid implicit browser style -