这是一个工作示例:http: //jsfiddle.net/Gajotres/Yz3nS/
因为 jQuery Mobile 需要支持 HTML5 的浏览器,所以您需要使用 css 媒体查询,它们将为您提供最大的灵活性。
HTML:
<!DOCTYPE html>
<html>
<head>
<title>jQM Complex Demo</title>
<meta name="viewport" content="width=device-width, height=device-height"/>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
</head>
<body>
<div data-role="page" id="index">
<div data-theme="a" data-role="header">
<h3>
First Page
</h3>
<a href="#second" class="ui-btn-right">Next</a>
</div>
<div data-role="content">
<ul data-role="listview" data-theme="a" data-inset="true">
<li data-role="list-divider">Listview 1</li>
<li><a href="item1.html">item1</a></li>
<li><a href="item1.html">item1</a></li>
<li><a href="item1.html">item1</a></li>
</ul>
<ul data-role="listview" data-theme="a" data-inset="true">
<li data-role="list-divider">Listview 2</li>
<li><a href="item1.html">item1</a></li>
<li><a href="item1.html">item1</a></li>
<li><a href="item1.html">item1</a></li>
</ul>
<ul data-role="listview" data-theme="a" data-inset="true">
<li data-role="list-divider">Listview 3</li>
<li><a href="item1.html">item1</a></li>
<li><a href="item1.html">item1</a></li>
<li><a href="item1.html">item1</a></li>
</ul>
<ul data-role="listview" data-theme="a" data-inset="true">
<li data-role="list-divider">Listview 4</li>
<li><a href="item1.html">item1</a></li>
<li><a href="item1.html">item1</a></li>
<li><a href="item1.html">item1</a></li>
</ul>
</div>
<div data-theme="a" data-role="footer" data-position="fixed">
</div>
</div>
</body>
</html>
和 CSS :
ul {
float: left; width: 100% !important;
}
/* iPhone Horizontal -------------------*/
@media all and (min-width: 480px){
ul { width: 100% !important; }
}
/* iPad Verticle -----------------------*/
@media only screen and (min-width: 768px) {
ul { width: 50% !important; }
}
/* iPad Horizontal ---------------------*/
@media only screen and (min-width: 1024px) {
ul { width: 50% !important; }
}
/* Nexus 7 Horizontal ------------------*/
@media only screen and (min-width: 1280px) {
ul { width: 33.3333333% !important; }
}
/* Laptop 1440 -------------------------*/
@media only screen and (min-width: 1440px) {
ul { width: 33.3333333% !important; }
}
/* Monitor 1600 ------------------------*/
@media only screen and (min-width: 1600px) {
ul { width: 25% !important; }
}
/* Monitor 1920 ------------------------*/
@media only screen and (min-width: 1920px) {
ul { width: 20% !important; }
}