jQuery Mobile - Preimpostazione del punto di interruzione

Descrizione

Per impilare griglie inferiori a 35em (560 px), è possibile applicare un punto di interruzione preimpostato. Nel contenitore della griglia includi.ui-responsive classe.

Esempio

L'esempio seguente mostra l'uso della classe reattiva in 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>Two Column Responsive Example</h2>
      <div class = "ui-grid-a ui-responsive">
         <div class = "ui-block-a">
            <div class = "ui-body ui-body-a">First Block</div>
         </div>
         
         <div class = "ui-block-b">
            <div class = "ui-body ui-body-b">Second Block</div>
         </div>
      </div>

      <h2>Three Column Responsive Example</h2>
      <div class = "ui-grid-b ui-responsive">
         <div class = "ui-block-a">
            <div class = "ui-body ui-body-a">First Block</div>
         </div>
         
         <div class = "ui-block-b">
            <div class = "ui-body ui-body-b">Second Block</div>
         </div>
         
         <div class = "ui-block-c">
            <div class = "ui-body ui-body-a">Third Block</div>
         </div>
      </div>

      <h2>Four Column Responsive Example</h2>
      <div class = "ui-grid-c ui-responsive">
         <div class = "ui-block-a">
            <div class = "ui-body ui-body-a">First Block</div>
         </div>
         <div class = "ui-block-b">
            <div class = "ui-body ui-body-b">Second Block</div>
         </div>
         
         <div class = "ui-block-c">
            <div class = "ui-body ui-body-a">Third Block</div>
         </div>
         
         <div class = "ui-block-d">
            <div class = "ui-body ui-body-b">Fourth Block</div>
         </div>
      </div>

      <h2>Five Column Responsive Example</h2>
      <div class = "ui-grid-d ui-responsive">
         <div class = "ui-block-a">
            <div class = "ui-body ui-body-a">First Block</div>
         </div>
         
         <div class = "ui-block-b">
            <div class = "ui-body ui-body-b">Second Block</div>
         </div>
         
         <div class = "ui-block-c">
            <div class = "ui-body ui-body-a">Third Block</div>
         </div>
         
         <div class = "ui-block-d">
            <div class = "ui-body ui-body-b">Fourth Block</div>
         </div>
         
         <div class = "ui-block-e">
            <div class = "ui-body ui-body-a">Fifth Block</div>
         </div>
      </div>

   </body>
</html>

Produzione

Eseguiamo i seguenti passaggi per vedere come funziona il codice sopra:

  • Salva il codice html sopra come breakpoint_preset.html file nella cartella principale del server.

  • Apri questo file HTML come http: //localhost/breakpoint_preset.html e verrà visualizzato il seguente output.