通过JavaScript切换jQuery Mobile Panel

时间:2015-04-23 13:44:29

标签: javascript jquery html jquery-mobile

在下面的屏幕中实现了一个jQuery Mobile Panel,它可以加载iFrame

<div data-role="panel" id="popupPanel1" data-theme="a" data-position="right" data-dismissible="false" data-display="push">
    <iframe src="" name="cFrame" id="cFrame">
     Browser does not support iFrame. Please contact your administrator.
    </iframe>
</div>
<iframe src="" name="mFrame" id="mFrame">
     Browser does not support iFrame. Please contact your administrator.
</iframe>

按钮打开面板加载在“mFrame”iFrame下,所以在点击一些功能后触发加载外部内容时,我已经通过JS $("#popupPanel1").panel("open");添加了打开面板的代码我尝试更改它到$("#popupPanel1").panel("toggle");

但这会使弹出窗口关闭它;在调试之后,原因是Panel在它之前被打开,因此它被关闭了。此外,我尝试检查它是否具有“ui-panel-open”类,结果显示相同,然后关闭。

0 个答案:

没有答案