【问题标题】:JQueryMobile not working properly with PhoneGapJQueryMobile 无法与 PhoneGap 一起正常工作
【发布时间】:2016-02-17 13:51:41
【问题描述】:

首先,我看到每一个问题都在 Stack 上说明了相同的问题,但没有一个问题适用于我的问题

我正在构建我的第一个 PhoneGap 应用程序,我想使用 jQueryMobile 库 无论如何,JQuery 样式不能正常工作,

我的索引.html

<!DOCTYPE html>


<html>
    <head>
        <meta charset="utf-8" />
        <meta name="format-detection" content="telephone=no" />
        <meta name="msapplication-tap-highlight" content="no" />
        <!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
        <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, target-densitydpi=device-dpi" />
        <link rel="stylesheet" type="text/css" href="css/jquery.mobile-1.4.5.min.css" />

        <link rel="stylesheet" type="text/css" href="css/index.css" />
        <title>Hello World</title>
    </head>
    <body>
        <div data-role="page" data-theme="b">

            <div data-role="header">
                <h1>Welcome To My Homepage</h1>
            </div>

            <div data-role="main" class="ui-content">
                <a href="#" class="ui-btn ui-btn-inline ui-corner-all">btn1</a>
                <p>I Am Now A Mobile Developer!!</p>
                <a href="#" class="ui-btn ui-btn-inline  ui-corner-all">btn2</a>

            </div>

            <div data-role="footer">
                <h1>Footer Text</h1>
            </div>

        </div>
        <script type="text/javascript" src="cordova.js"/>
        <script type="text/javascript" src="./js/jquery-1.12.0.min.js"/>
        <script type="text/javascript" src="./js/jquery.mobile-1.4.5.min.js"/>
        <script type="text/javascript" src="js/index.js"/>
        <script type="text/javascript">
            app.initialize();
        </script>
    </body>
</html>

结果是

你可以看到按钮内联和角所有属性都工作正常,但仍然不是预期的P

【问题讨论】:

  • 在这里查看教程 -- youtube.com/watch?v=rW0Trnx7Yjo
  • 你可以试试&lt;div data-role="footer" data-position="fixed"&gt; 吗?
  • @BipBip 这与页脚位置无关,未应用样式它应该赋予特定颜色并查看页眉和页脚
  • @Tasos,我确实按照教程进行操作,同样的问题:D

标签: jquery-mobile


【解决方案1】:

你没有正确引用它们 删除点。我按照你的css文件所在的文件夹结构,你的java脚本文件应该在这里/js而不是./js

所以像这样引用
[代码]
[/代码]

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-12-22
    • 1970-01-01
    • 1970-01-01
    • 2017-12-14
    • 2020-08-19
    • 2013-02-06
    • 2019-02-02
    • 2021-10-15
    相关资源
    最近更新 更多