2016-02-26 47 views
0

我的導航欄根本不起作用。它不顯示在屏幕上,我不知道我在做什麼錯誤!爲什麼Navbar從jquery mobile和phonegap app不顯示?

我在做一個使用JQuery Mobile和PhoneGap的移動應用程序。

貝婁你會發現我所有的東西我引用所有我的index.html文件。

我正在使用phonegap Cli(命令行),現在我正在測試瀏覽器。

代碼波紋管:

<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, width=device-width, height=device-height, 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" /> 
     <link rel="stylesheet" type="text/css" href="css/mycss.css" /> 

     <script type="text/javascript" src="cordova.js"></script> 
     <script type="text/javascript" src="js/jquery-2.2.1.js"></script> 
     <script type="text/javascript" src="js/jquery.mobile-1.4.5.min.js"></script> 
     <script type="text/javascript" src="js/index.js"></script> 
     <script type="text/javascript" src="js/myjs.js"></script> 

     <!--<script type="text/javascript"> 
      //app.initialize(); 
      xyz.initialize(); 
     </script>--> 
     <title>xyz</title> 
    </head> 
    <body> 
     <div data-hole="page" id="Page1"> 
      <div data-hole="header" data-position="fixed"> 
       <h1>xyz</h1> 
       <div data-hole="navbar"> 
       <ul>  
        <li><a href="#index" data-icon="home">Home</a>  
        <li><a href="#contacts" data-icon="search">Contacts</a>  
        <li><a href="#events" data-icon="info">Events</a>  
        <li><a href="#news" data-icon="grid">News</a>  
       </ul> 
       </div> 
      </div> 
      <div data-hole="content"> 
       <button onclick="showPopup()">Show Popup</button> 
      </div> 
      <div data-hole="footer"> 
       My Footer 
      </div> 
     </div> 
     <!--<div class="app"> 
      <h1>PhoneGap</h1> 
      <div id="deviceready" class="blink"> 
       <p class="event listening">Connecting to Device</p> 
       <p class="event received">Device is Ready</p> 
      </div> 
     </div>--> 
     <!--<div class="xyz"> 
      <div data-hole="footer"> 
       <div data-hole="navbar"> 
        <ul> 
         <li><a href="#" data-icon="grid">Summary</a></li> 
         <li><a href="#" data-icon="star" class="ui-btn-active">Favs</a></li> 
         <li><a href="#" data-icon="gear">Setup</a></li> 
        </ul> 
       </div> 
      </div> 
     </div>--> 


    </body> 
</html> 

回答

1

有錯誤在你的代碼是data-role,而不是數據 -

HTML:

<div data-role="page" id="Page1"> 
      <div data-role="header" data-position="fixed"> 
       <h1>xyz</h1> 
       <div data-role="navbar"> 
       <ul>  
        <li><a href="#index" data-icon="home">Home</a>  
        <li><a href="#contacts" data-icon="search">Contacts</a>  
        <li><a href="#events" data-icon="info">Events</a>  
        <li><a href="#news" data-icon="grid">News</a>  
       </ul> 
       </div> 
      </div> 
      <div data-role="content"> 
       <button onclick="showPopup()">Show Popup</button> 
      </div> 
      <div data-role="footer"> 
       My Footer 
      </div> 
     </div> 
+0

問題解決了! (我感覺就像需要使用玻璃杯!) – alexscjava

+0

它發生了:)。如果它適用於你,那麼請接受答案,所以這個問題不會添加到沒有答案的列表中。 – Pbk1303