In my JavaScript code for developing Windows 8 apps, I have set the max-height of an element to 65vh. I now require a method to convert this value into pixels in order to determine if an image can adequately fit within this space or if adjustments need to be made through resizing or cropping.
The plan is to calculate this conversion by utilizing the formula:
Since 100 vh is equivalent to screen.height
, it follows that 65vh in pixels would equal screen.height * 0.65
.