2014-05-23 65 views
0

我正在使用JQM v1.4制作移动网站。jquery移动单页打开为弹出

我将页面作为每个HTML。例如)sub1.html,sub2.html,sub3.html

这是可能的,当点击sub1.html中的东西时打开sub2.html作为弹出(对话框)?

回答

1

JQuery mobile可以在弹出窗口中打开另一个页面。它被称为Popup iframe。

<a href="#popupMap" data-rel="popup" data-position-to="window" class="ui-btn ui-corner-all ui-shadow ui-btn-inline">Open Map</a> 
<div data-role="popup" id="popupMap" data-overlay-theme="a" data-theme="a" data-corners="false" data-tolerance="15,15"> 
    <a href="#" data-rel="back" class="ui-btn ui-btn-b ui-corner-all ui-shadow ui-btn-a ui-icon-delete ui-btn-icon-notext ui-btn-right">Close</a> 
    <iframe src="sub2.html" width="480" height="320" seamless=""></iframe> 
</div> 

检查的文档: http://demos.jquerymobile.com/1.4.2/popup-iframe/http://demos.jquerymobile.com/1.4.2/popup/

+0

另外,请避免使用对话框作为别处建议。它们在1.4中被弃用,并将在1.5中被删除。见[这里](http://api.jquerymobile.com/dialog/) –

+0

谢谢你非常有帮助... – user3400080