jQuery Mobile - Predefinição de ponto de interrupção

Descrição

Para empilhar grades abaixo de 35em (560px), um ponto de interrupção predefinido pode ser aplicado. No recipiente da grade, inclua.ui-responsive classe.

Exemplo

O exemplo a seguir demonstra o uso da classe responsiva no 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>

Resultado

Vamos realizar as seguintes etapas para ver como funciona o código acima -

  • Salve o código html acima como breakpoint_preset.html arquivo na pasta raiz do servidor.

  • Abra este arquivo HTML como http: //localhost/breakpoint_preset.html e a seguinte saída será exibida.