0

我喜欢建立一个弹出窗口,但它不起作用。我从 jquery mobile 文档中举了一个例子。 http://filamentgroup.com/tests/popup/docs/pages/popup/

<!DOCTYPE html> 
<html>
    <head>
        <meta http-equiv="Content-Type" content="text-html" ; charset=UTF-8" />
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" />      
      <link rel="stylesheet" href="style.css">
      <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
      <script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>

    </head> 
    <body>
      <div data-role="page">
          <div data-role="header">
              <h1>Basic plugin</h1>
          </div>
          <div data-role="content">

          <a href="#popupBasic" data-rel="popup">Tooltip</a>
          <div data-role="popup" id="popupBasic">
              This is a completely basic popup, no options set.
          </div>
          </div>
      </div>
  </body>
</html>
4

1 回答 1

0

您需要使用更高版本的 jQuery Mobile,因为弹出窗口仅在 v1.2 中引入。

<!DOCTYPE html> 
<html>
    <head>
        <meta http-equiv="Content-Type" content="text-html" ; charset=UTF-8" />
        <meta name="viewport" content="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" />      
        <link rel="stylesheet" href="style.css">
        <script src="http://code.jquery.com/jquery-1.7.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">
            <div data-role="header">
                <h1>Basic plugin</h1>
            </div>
            <div data-role="content">

            <a href="#popupBasic" data-rel="popup">Tooltip</a>
            <div data-role="popup" id="popupBasic">
                This is a completely basic popup, no options set.
            </div>
            </div>
        </div>
    </body>
</html>

工作jsfiddle链接

于 2013-11-05T12:57:16.493 回答