Get page content width
Description
The following code shows how to get page content width.
Example
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet"
href="http://ajax.aspnetcdn.com/ajax/jquery.mobile/1.0/jquery.mobile-1.0.min.css" />
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js"></script>
<meta name="viewport" id="viewport" content="width=320, user-scalable=no" />
<script
src="http://ajax.aspnetcdn.com/ajax/jquery.mobile/1.0/jquery.mobile-1.0.min.js"></script>
<script type="text/javascript">
$( 'div' ).live( 'pageshow',function(event, ui){
alert( $("#test").width() );
});<!--from w w w . java 2 s . c o m-->
</script>
</head>
<body>
<div data-role="page">
<div data-role="header" data-theme="d">
<h1>Title</h1>
</div>
<!-- /header -->
<div data-role="content" data-theme="d">
<div id="test">content</div>
</div>
<!-- /content -->
</div>
<!-- /page -->
</body>
</html>
</body>
</html>