How to find the device width using the view port meta tag.
Also wants to display the device width in the console with
java script.
How to find the device width using the view port meta tag.
Also wants to display the device width in the console with
java script.
The viewport
dimensions can be gotten through the window
object:
var viewport = {
width : $(window).width(),
height : $(window).height()
};
//can access dimensions like this:
//viewport.height
Though you won't always get perfect results, different devices behave differently and this gives the viewport
dimensions, not the screen dimensions.
Refer this post
more details on how to check the width of a data-role="page"
element to find the device-width