javascript convert px to vw
snippet in javascript

javascript convert px to vw

user7290

//1px = 100vw / viewport's width (in px)

function convertPXToVW(px) {
	return px * (100 / document.documentElement.clientWidth);
}