<!-- 搜索表单 --> <div data-role="popup" id="searchProductPopup" data-theme="d"> <a href="#" data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn-a ui-icon-delete ui-btn-icon-notext ui-btn-right">close</a> <div data-role="header" data-theme="d"> <h1>搜索商品</h1> </div> <div style="padding: 10px 20px"> <form name="subForm" id="subForm" action="${ctx}/mobile/listProduct"> <div data-role="fieldcontain"> <label for="keyWord">商品名称:</label> <input type='text' value="${formdata.keyWord}" id="keyWord" name="keyWord"> </div> <div data-role="fieldcontain"> <label for="minPrice">价格:</label> <input id="minPrice" name="minPrice" size="10" value="${formdata.minPrice}" type="number"> <strong>到</strong> <input id="maxPrice" name="maxPrice" size="10" value="${formdata.maxPrice}" type="number"> </div> <input type="submit" value="查询" /> </form> </div> </div>
<script> /*在DOMReady时初始化popUP */ $(function(){ $( "#searchProductPopup" ).enhanceWithin().popup(); }); </script>
要点: (1)把这段代码紧挨着body写,就是让这个div在任何一个page之外 <body> ... <div data-role="popup".. .. </div> .. <div data-role="page"> .. ... </body>
(2)用这段js初始化
$(function(){ $( "#searchProductPopup" ).enhanceWithin().popup(); });
也不懂为啥这么写,反正不写就有时候点不出来popup。
|