Detect viewport orientation, if orientation is Portrait display alert message advising user of instructions

I am building a website specifically for mobile devices. There is one page in particular which is best viewed in landscape mode. Is there a way to detect if the user visiting that page is viewing it in Portrait mode and if so, display a message informing the user that the page is best viewed … Read more

Get viewport/window height in ReactJS

How do I get the viewport height in ReactJS? In normal JavaScript I use window.innerHeight() but using ReactJS, I’m not sure how to get this information. My understanding is that ReactDOM.findDomNode() only works for components created. However this is not the case for the document or body element, which could give me height of the … Read more

How do you disable viewport zooming on Mobile Safari?

I’ve tried all three of these to no avail: <meta name=”viewport” content=”width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;” /> <meta name=”viewport” content=”width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=false;” /> <meta name=”viewport” content=”width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;” /> each are different values I found recommended by google searching or SO searching, but none of the ‘user-scalable=X‘ values seem to be working I also … Read more

How to get the browser viewport dimensions?

I want to provide my visitors the ability to see images in high quality, is there any way I can detect the window size? Or better yet, the viewport size of the browser with JavaScript? See green area here: 17 s 17 Cross-browser @media (width) and @media (height) values  const vw = Math.max(document.documentElement.clientWidth || 0, … Read more