My JavaScript function is designed to apply a style.right property to an element based on the media width. There are three different styles that can be applied:
listElements[i].style.right = "calc(425 * " + portfolioScrollPosition + "px)";
or
listElements[i].style.right = "calc(33.333 * " + portfolioScrollPosition + "vw)";
or
listElements[i].style.right = "calc(50 * " + portfolioScrollPosition + "vw)";
I need these styles to be written into HTML with embedded styles exactly as shown above. However, the calc() function simplifies the output to something like calc(425px). Is there a way to prevent JavaScript from making this simplification?