On a phone, how to reset the screen width to the portrait default after rotating back to portrait?

0
The mobile app is just a responsive webpage, nothing native.   In portrait, the width of the scrollContainer is 780, which works perfect. If the phone is now rotated from portrait to landscape, the scrollContainer width is set to 1688. Rotating it back to portrait, the width stays on 1688.   I need it to go back to 780.   Anybody an idea how to accomplish that?
asked
2 answers
0

Hey Toon, 

 

Try this and let me know if it works for you!

 

.mx-name-profileScrollContainer { 

  // This forces the container to never be wider than its parent   

  max-width: 100% !important;

  // As an alternative, you can force it to the viewport width   

  // width: 100vw !important;

}

answered
0

Hi Toon,

 

try the below one and let me know if that works for you

 

.scrollContainer {  width: 100%;}

@media screen and (orientation: portrait) {  .scrollContainer {    max-width: 780px;  }}

@media screen and (orientation: landscape) {  .scrollContainer {    max-width: 1688px;  }}

answered