jQuery Mobile - 網格單列類



說明

ui-grid-solo 類用於建立一個單列,其中包含類 ui-block-a 作為子容器。

示例

以下示例演示如何在 jQuery Mobile 中使用網格單列類。

<!DOCTYPE html>
<html>
   <head>
      <meta name = "viewport" content = "width = device-width, initial-scale = 1">
      <link rel = "stylesheet" href = "https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
      <script src = "https://code.jquery.com/jquery-1.11.3.min.js"></script>
      <script src = "https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
   </head>
   
   <body>
      <h2>Grid Solo Class Example</h2>
      <div class = "ui-grid-a">
         <div class = "ui-block-a">
            <a class = "ui-btn ui-corner-all ui-shadow ui-btn-a">Button 1</a>
         </div>
         
         <div class = "ui-block-b">
            <a class = "ui-btn ui-corner-all ui-shadow ui-btn-b">Button 2</a>
         </div>
      </div>
      
      <div class = "ui-grid-solo">
         <div class = "ui-block-a">
            <input type = "button" value = "More" />
         </div>
      </div>
      
   </body>
</html>

輸出

讓我們執行以下步驟來看看上述程式碼如何工作 -

  • 將上述 html 程式碼另存為伺服器根資料夾中的 grid_solo_class.html 檔案。

  • 以 https:///grid_solo_class.html 的形式開啟此 HTML 檔案,將顯示以下輸出。

jquery_mobile_layouts.htm
廣告
© . All rights reserved.