0

I have a right side slide in menu. I want to shrink the main page content when the menu is visible. The menu is 320px wide.

https://jsfiddle.net/39d5cwo7/25/

Problem:

How can I scale the main content area down like this:

transform: scale( calc( calc(100vw - 320px) / 100vw ) );     /*  invalid  */

Here I attempt to take the full screen width and remove the menu width. Then turn this into a percentage by dividing by the full screen width, which is then the proper scale of the main content (units should be removed by the division...mathematically anyway).

Firefox and Chrome consider this invalid. I'd prefer to do this in css but if required how can this be done in javascript?

Things I've tried:

transform: scale(calc( calc(1920 - 320) / 1920 ));          /*  works but not responsive */
transform: scale(calc( calc(1920px - 320px) / 1920px ));    /*  invalid  */
Stib
  • 86
  • 1
  • 7

0 Answers0