3 ms·
I thought it used Javascript to detect screen size. At least it should react to resize events and if the dimensions are something that align with mobile, it sh
by tenebrisalietum 7y ago
I thought it used Javascript to detect screen size. At least it should react to resize events and if the dimensions are something that align with mobile, it should switch to mobile mode.
- NilsIRL 7y agoAFAIK it's also done using CSS
- wlesieutre 7y agoIn a lot of cases you shouldn't even use Javascript for this, responsive layouts can be built using CSS media queries based on viewport size. More advanced webapps might occasionally need to do something fancier than that if the mobile vs desktop functionality is (for some reason) substantially different instead of just rearranged. https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queri...