jQuery Mobile 提供了一套主题框架,允许你轻松地自定义应用的外观。这些主题包括不同颜色方案和样式,使你能够根据自己的需求调整应用的外观。

以下是一个简单的例子,展示如何在 jQuery Mobile 中使用主题:
<!DOCTYPE html>
<html>
<head>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
  <script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
  <script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
</head>
<body>

<div data-role="page" data-theme="b">
  <div data-role="header">
    <h1>主题示例</h1>
  </div>

  <div data-role="main" class="ui-content">
    <p>这是一个使用主题的页面。</p>
  </div>

  <div data-role="footer" data-theme="b">
    <h4>页脚文本</h4>
  </div>
</div>

</body>
</html>

在这个例子中,data-theme 属性用于指定页面或元素所使用的主题。在 <div data-role="page" data-theme="b"> 中,data-theme="b" 表示这个页面使用主题 B。页脚也使用了相同的主题。

你可以根据自己的需求选择不同的主题,主题的名称包括 a, b, c, d, e,每个主题都对应不同的颜色和样式。同时,你还可以使用自定义的主题。




转载请注明出处:http://www.zyzy.cn/article/detail/14463/jQuery Mobile