我喜欢构建一个弹出窗口,但它不起作用。我从jquery移动文档中拿了一个例子。 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>
答案 0 :(得分: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>
<强> Working jsfiddle link 强>