var OpenPopup1=function(){ $('#aa').popup('open'); } var OpenPopup2=function(){ var dialog=$('<div data-role="popup" id="popupCloseRight" data-overlay-theme="a" data-theme="c" class="ui-content" style="max-width:280px"> <a href="#" data-rel="back" data-role="button" data-theme="a" data-icon="delete" data-iconpos="notext" class="ui-btn-right">Close</a> <div data-role="content"><p>I have a close button at the top right corner with simple HTML markup.</p> <a href="#" data-role="button" data-inline="true" data-rel="back" data-theme="c">Cancel</a><a href="#" data-role="button" data-inline="true" data-rel="back" data-transition="flow" data-theme="b">Delete</a></div></div>'); $.mobile.activePage.append(dialog); dialog.trigger("create") ; dialog.popup(); dialog.popup('open'); }
在页面HTML中有一个id="aa" data-role="popup" 的元素,
调用OpenPopup1()方法正常显示,
调用OpenPopup2()方法显示样式存在问题
求高手帮忙解决,感激不尽!!!!!!!!!!!!!
第一个方法在open之前应该初始化:$('#aa').popup();