繁体   English   中英

JQuery Mobile Panel小部件会杀死页面

[英]JQuery Mobile Panel widget kills page

我正在尝试将一个面板添加到我的jquery移动页面,但每当我将代码放入其中时,只显示带有加载小部件的白色屏幕,并且不会执行任何其他操作。 我正在使用由Google托管的JQuery 2.0.0,由JQuery托管的JQuery Mobile JS 1.3.1,以及由JQuery托管的JQuery Mobile css,但似乎仍然无法实现这一点。 面板代码也直接从JQuery Mobile文档中提取。

这是我所拥有的,它是一个简单的登录页面:

<div data-role="page" id="mainPage">
    <!-- leftpanel1  -->
    <div data-role="panel" id="leftpanel1" data-position="left" data-display="reveal" data-dismissible="true" data-theme="a">

        <div class="panel-content">
            <h3>Left Panel: Reveal</h3>
            <p>This panel is positioned on the left with the reveal display mode. The panel markup is <em>after</em> the header, content and footer in the source order.</p>
            <p>To close, click off the panel, swipe left or right, hit the Esc key, or use the button below:</p>
            <a href="#demo-links" data-rel="close" data-role="button" data-theme="a" data-icon="delete" data-inline="true">Close panel</a>
        </div><!-- /content wrapper for padding -->

    </div><!-- /leftpanel1 -->
    <div data-role="content">
        <div id="logo"><img src="img/logo.png" style="width:100%;height:25%"></div>
        <br /><br /><br />
        <a href="#popupLogin" data-rel="popup" data-position-to="window" data-role="button" data-transition="flow">Login</a>
        <br />
        <a href="#leftpanel1" data-role="button" data-inline="true" data-mini="true">Reveal</a>
        <a href="moreInfo" data-role="button">More Info</a>
        <br /><br /><br /><br /><br />
        New to 2Gen? <a href="#register">Sign up for an account.</a>
        <div data-role="popup" id="popupMenu">
            <div data-role="popup" id="popupLogin">
                <div data-role="fieldcontain">
                    <div style="padding:10px 20px;">
                        <h3>Please sign in</h3>
                            <input class="inputBox" type="text" id="loginUsername" value="" placeholder="Username">
                            <input class="inputBox" type="password" id="loginPassword" value="" placeholder="Password">
                            <br />
                            <div class="ui-grid-a">
                                <div class="ui-block-a">
                                    <input type="checkbox" data-mini="true" id="rememberMeCheckbox" name="rememberMeCheckbox">
                                    <label for="rememberMeCheckbox">Remember<br /> Me</label></div>
                                <div class="ui-block-b"><a href="#" onclick="login()" data-role="button" data-mini="true">Login</a>
                                </div></div>
                            </div><!-- /grid-a -->
                    </div>
                </div>
            </div>
        </div>
</div><!-- /page -->

非常感谢任何帮助,谢谢

以下是我的结论: http//jsfiddle.net/3dxKW/2/

编辑:

我弄清楚为什么它不起作用,显然它不喜欢我使用JQuery 2.0.0时,所以当我切换到1.9.1时,它工作得很好。

我刚刚在jsfiddle.net上尝试过它并运行http://jsfiddle.net/ouadie/3dxKW/

    <div data-role="panel" id="leftpanel1"
     data-position="left" data-display="reveal"
     data-dismissible="true" data-theme="a">

    <div class="panel-content">
       ...
    </div>
  </div>

http://jquerymobile.com/demos/1.3.0/docs/widgets/panels/

jQuery Mobile 1.3尚不支持jQuery 2.0。

仅从1.4版本开始,它将与jQuery 2.0一起使用(7月 - 8月)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM