jQuery Mobile es una tecnología basada en la web que se utiliza para crear contenido receptivo al que se puede acceder en todos los teléfonos inteligentes, tabletas y computadoras de escritorio. En este artículo, crearemos un mini botón usando jQuery Mobile.
Enfoque: Primero, agregue los scripts jQuery Mobile necesarios para su proyecto.
<enlace rel=”hoja de estilo” href=”http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css” />
<script src=”http://code .jquery.com/jquery-1.11.1.min.js”></script>
<script src=”http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min .js”></secuencia de comandos>
Usaremos diferentes tipos de clases y tipos de interfaz de usuario para crear los botones de marcado.
Ejemplo 1: Usaremos la etiqueta Anchor con class=”ui-btn ui-mini” para hacer el botón.
<!DOCTYPE html> <html> <head> <link rel="stylesheet" href= "http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" /> <script src= "http://code.jquery.com/jquery-1.11.1.min.js"> </script> <script src= "http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"> </script> </head> <body> <center> <h1>GeeksforGeeks</h1> <h4>Mini Anchor using jQuery Mobile</h4> </center> <a href="https://www.geeksforgeeks.org/" class="ui-btn ui-mini"> Mini Anchor </a> </body> </html>
Producción:
Ejemplo 2: Usaremos la etiqueta del botón con class=”ui-btn ui-mini” para nuestro propósito.
<!DOCTYPE html> <html> <head> <link rel="stylesheet" href= "http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" /> <script src= "http://code.jquery.com/jquery-1.11.1.min.js"> </script> <script src= "http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"> </script> </head> <body> <center> <h1>GeeksforGeeks</h1> <h4>Mini buttons using jQuery Mobile</h4> </center> <button class="ui-btn ui-mini" id="gfg"> Mini Button </button> </body> </html>
Producción: