使用对话框加载页面

时间:2014-02-12 18:46:05

标签: jquery-mobile

我正在构建一个多页面的移动Web应用程序,其中每个页面都可以选择具有其特定的对话框。有没有办法将对话框与页面一起加载?

a.html

<!DOCTYPE html>
<html>
<head>
  <title>B4DATING</title>
  <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1">
  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css" />
  <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
  <script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
</head>
<body>

<div data-role="page" data-theme="b">
  <div data-role="header" data-position="fixed">
    <h1>Page A</h1>
  </div>

  <div data-role="content"> 
    <a href="b.html" data-role="button">Push me</a>
  </div>
</div>

</body>
</html>

b.html

<div data-role="page" data-theme="b">
  <div data-role="header" data-position="fixed">
    <h1>Page B</h1>
    <a href="#menu" data-icon="plus" data-iconpos="notext" data-theme="b" class="ui-btn-right" data-rel="dialog">more</a>
  </div>

  <div data-role="content"> 
    Welcome to Page B!
  </div>
</div>

<div data-role="dialog" id="menu" class="dialog-actionsheet">
  <div data-role="header" data-theme="d">
    <h1>Menu B</h1>
  </div>

  <div data-role="content" data-theme="c">
    <ul data-role="listview" data-inset="false" data-theme="d" data-divider-theme="d"  data-icon="false" class="jqm-list">
      <li><a href="#">X</a></li>
      <li><a href="#">Y</a></li>
      <li><a href="#">Z</a></li>
    </ul>
  </div>
</div>

我需要的是使对话框正常工作(没有进一步的AJAX请求)。只需要通过jQuery Mobile处理并导入到DOM中的整个HTML。

0 个答案:

没有答案