0
I can use @media screen and (orientation:portrait) {} so that my code only works on mobile devices ?
'Cause I think cell phones and smartphones are the only ones who possess $(window).height() greater than $(window).width() or the height of the screen greater than the width.
Perhaps you’d better explain what you intend to do.
– Renan Gomes
It is possible for height to be greater than width on desktops, many designers use the side-facing display to increase the vertical visual area for drawing. So this can’t be a determining factor for you to check whether or not it’s mobile. See @Lucas' reply below, with css is the best way
– Renan Borges