Change Popup width dynamically

Change Popup width dynamically

Hi,

I would like to create a responsive Popup where eg Desktop view, width=400px, Mobile view, width=100%. But I can't get it to work especially width=100%.

I prefer not using CSS media, instead I prefer using CSS Name, or by jquery function control according to my own specified breakpoint.

There got to be something I do not know. Something to do with rendering before popup open?

I'm aware of using CSS #<id>-popup { }, but that can only take effect on load.

Anyone can help point out where or which part I should look into would be very much appreciated.

Thank you.