Mostrando entradas con la etiqueta html5. Mostrar todas las entradas
Mostrando entradas con la etiqueta html5. Mostrar todas las entradas

miércoles, 16 de septiembre de 2015

jQuery Spinbox - Crear un input number con jQuery y CSS3


Hola, en esta ocasión os traigo un método jQuery llamado spinbox que os servirá para emular el elemento input number de HTML5, el método spinbox puede ser muy útil para implementarlo en navegadores en los que el elemento input number no es compatible, de hecho, es peculiar que un navegador como Google Chrome en el S.O Android no acepta este elemento.

El método spinbox acepta las opciones fundamentales del input number como son: min, max, value y step. Cada una de ellas pueden ser configuradas al gusto.

Por defecto las opciones vienen con los siguientes valores:

 var defaults = {
  min: 0,
  max: 100,
  value: 0,
  step: 1
 };


Los icono de incremento y decremento son proporcionados por Font Awesome, estilizar el spinbox ya es cuestión de lo que necesitéis, CSS3 está en vuestras manos.

A continuación podéis ver unos ejemplos con un spinbox básico, un spinbox con números negativos y un spinbox con número en punto flotante y al final el código con el plugin y los ejemplos.



Spinbox by jQuery Manual

Por defecto

Números negativos: {min: -50, max: 50, value: -50}

Números en punto flotante: {min: 0, max: 10, value: 0, step: 0.1}



Código fuente del plugin con los ejemplos ...

<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8" />
<script type="text/javascript" src="https://code.jquery.com/jquery.js"></script>
<!-- Icons -->
<link rel="stylesheet" type="text/css" href="https://fortawesome.github.io/Font-Awesome/assets/font-awesome/css/font-awesome.css" />

<script>

(function($){ 
/* Author: Manu Dávila | Web: http://jquery-manual.blogspot.com */
 $.fn.spinbox = function(options){
 var defaults = {
  min: 0,
  max: 100,
  value: 0,
  step: 1
 };
 if (options === undefined){options = defaults;}
 if (options.min === undefined) {options.min = defaults.min;}
 if (options.max === undefined) {options.max = defaults.max;}
 if (options.value === undefined) {options.value = defaults.value;}
 if (options.step === undefined) {options.step = defaults.step;}
 
 options.min = parseFloat(options.min);
 options.max = parseFloat(options.max);
 options.value = parseFloat(options.value);
 options.step = parseFloat(options.step);
 
 var input = this.find("input");
 var spin_up = this.find(".spin-up");
 var spin_down = this.find(".spin-down");
 
 input.val(options.value);
 
 spin_up.on("click", function(){
 
 if (Number(input.val()) !== NaN){
 
  if (parseFloat(input.val()) > options.max || parseFloat(input.val()) < options.min)
  {
   input.val(options.max);
   return;
  }
  
  if (parseFloat(input.val()) < options.max)
  {
  
   value = parseFloat(input.val())+options.step;
   if (String(value).match(/\./) && String(options.step).match(/\./))
   {
    max_decimal = String(options.step).split(".")[1];
    value = value.toFixed(max_decimal);
   }
   input.val(value);
  }
 }
 });
 
 spin_down.on("click", function(){
 if (Number(input.val()) !== NaN){
 
  if (parseFloat(input.val()) < options.min || parseFloat(input.val()) > options.max)
  {
   input.val(options.min);
   return;
  }
  
  if (parseFloat(input.val()) > options.min)
  {
   value = parseFloat(input.val())-options.step;
   if (String(value).match(/\./) && String(options.step).match(/\./))
   {
    max_decimal = String(options.step).split(".")[1];
    value = value.toFixed(max_decimal);
   }
   input.val(value);
  }
 }
 });
 
 
 };
})(jQuery);

 $(function(){
 $("#spinbox-1").spinbox();
 $("#spinbox-2").spinbox({min: -50, max: 50, value: -50});
 $("#spinbox-3").spinbox({min: 0, max: 10, value: 0, step: 0.1});
 });
</script>

<style>
.input-spinbox{
 border: 1px solid #D2E3EB;
 border-radius: 2px;
 padding-top: 5px;
 padding-bottom: 5px;
 padding-right: 2px;
 padding-left: 2px;
}

.input-spinbox:focus{
 border-color: 2px solid #2C426D;
}

.spin-up{
position: relative; 
left: -18px; 
top: -6px;
background-color: #5371AE;
color: #fff;
border-radius: 2px 2px;
}

.spin-down{
position: relative;
left: -36px;
top: 6px;
background-color: #5371AE;
color: #fff;
border-radius: 0px 0px 2px 2px;
}

.spin-up:hover, .spin-down:hover{
 cursor: pointer;
}

</style>

</head>
<body>
<h1>Spinbox by <a href="http://jquery-manual.blogspot.com">jQuery Manual</a></h1>
<h3>Por defecto</h3>
<div id="spinbox-1">
 <input type="text" name="spinbox-1" class="input-spinbox" />
 <span class="spin-up fa fa-angle-up fa-lg"></span>
 <span class="spin-down fa fa-angle-down fa-lg"></span>
</div>
<h3>Números negativos: {min: -50, max: 50, value: -50}</h3>
<div id="spinbox-2">
 <input type="text" name="spinbox-2" class="input-spinbox" />
 <span class="spin-up fa fa-angle-up fa-lg"></span>
 <span class="spin-down fa fa-angle-down fa-lg"></span>
</div>
<h3>Números en punto flotante: {min: 0, max: 10, value: 0, step: 0.1}</h3>
<div id="spinbox-3">
 <input type="text" name="spinbox-3" class="input-spinbox" />
 <span class="spin-up fa fa-angle-up fa-lg"></span>
 <span class="spin-down fa fa-angle-down fa-lg"></span>
</div>
</body>
</html>


lunes, 14 de septiembre de 2015

jQuery Bounce - Efecto rebote con jQuery y CSS3 animations


En esta ocasion os traigo un método jQuery llamado bounce que te permitirá asignar un efecto bounce (rebote) a los elementos visibles del DOM html, para el efecto se utiliza CSS3 animations. por ejemplo, al hacer click o pasar el mouse sobre una imagen o tal vez un determinado div puedes mostrar un atractivo efecto rebote como podrás ver en los diferentes ejemplo que vienen a continuación.

Opciones por defecto del plugin:

 defaults = {
  pixels: 20,
  duration: 0.5,
  delay: 0,
  iteration_count: 1,
  direction: 'normal',
  timing_function: 'linear'
 };



Haz click en los círculos para ver el efecto Bounce

Default

{pixels: 40, duration: 1, direction: 'alternate', timing_function: 'ease-in-out'}

{duration: 0.7, timing_function: 'cubic-bezier(30,10,30,10)'}

Pasa el mouse sobre la siguiente imagen ...



Código fuente del plugin con los ejemplos ...

<html>
<head>
<meta charset="UTF-8" />
<script type="text/javascript" src="https://code.jquery.com/jquery.js"></script>

<script>
//Author: Manu Dávila | Web: http://jquery-manual.blogspot.com
(function($){
$.fn.bounce = function(options){
 defaults = {
  pixels: 20,
  duration: 0.5,
  delay: 0,
  iteration_count: 1,
  direction: 'normal',
  timing_function: 'linear'
 };
 
 if (options === undefined){options = defaults;}
 if (options.pixels === undefined) {options.pixels = defaults.pixels;}
 if (options.duration === undefined) {options.duration = defaults.duration;}
 if (options.delay === undefined) {options.delay = defaults.delay;}
 if (options.iteration_count === undefined) {options.iteration_count = defaults.iteration_count;}
 if (options.direction === undefined) {options.direction = defaults.direction;}
 if (options.timing_function === undefined) {options.timing_function = defaults.timing_function;}
 
 b_plus_width = new Array();
 b_plus_height = new Array();
 b_plus_width[0] = parseInt(this.width()+options.pixels);
 b_plus_height[0] = parseInt(this.height()+options.pixels);
 b_plus_width[1] = parseInt(this.width()+(options.pixels / 1.8));
 b_plus_height[1] = parseInt(this.height()+(options.pixels / 1.8));
 b_plus_width[2] = parseInt(this.width()+(options.pixels / 1.4));
 b_plus_height[2] = parseInt(this.height()+(options.pixels / 1.4));
 b_plus_width[3] = parseInt(this.width()+(options.pixels / 1.2));
 b_plus_height[3] = parseInt(this.height()+(options.pixels / 1.2));
 
 b_less_width = new Array();
 b_less_height = new Array();
 b_less_width[0] = parseInt(this.width()-options.pixels);
 b_less_height[0] = parseInt(this.height()-options.pixels);
 b_less_width[1] = parseInt(this.width()-(options.pixels / 1.2));
 b_less_height[1] = parseInt(this.height()-(options.pixels / 1.2));
 b_less_width[2] = parseInt(this.width()-(options.pixels / 1.4));
 b_less_height[2] = parseInt(this.height()-(options.pixels / 1.4));
 b_less_width[3] = parseInt(this.width()-(options.pixels / 1.8));
 b_less_height[3] = parseInt(this.height()-(options.pixels / 1.8));
 
 animation = "animation"+Math.floor((Math.random() * 1000000000000000) + 1);

 
 this.find(".style-bounce").remove();
 
 this.append("<style class='style-bounce'>@keyframes "+animation+" {12.5%{width: "+b_less_width[0]+"px; height: "+b_less_height[0]+"px;}25%{width: "+b_plus_width[0]+"px; height: "+b_plus_height[0]+"px;}37.5.%{width: "+b_less_width[1]+"px; height: "+b_less_height[1]+"px;}50%{width: "+b_plus_width[1]+"px; height: "+b_plus_height[1]+"px;}62.5%{width: "+b_less_width[2]+"px; height: "+b_less_height[2]+"px;}75%{width: "+b_plus_width[2]+"px; height: "+b_plus_height[2]+"px;}87.5%{width: "+b_less_width[3]+"px; height: "+b_less_height[3]+"px;}100%{width: "+b_plus_width[3]+"px; height: "+b_plus_height[3]+"px;}}</style>");
 this.css("animation-name", ""+animation+"");
 this.css("animation-duration", ""+options.duration+"s");
 this.css("animation-delay", ""+options.delay+"s");
 this.css("animation-iteration-count", ""+options.iteration_count+"");
 this.css("animation-direction", ""+options.direction+"");
 this.css("animation-timing-function", ""+options.timing_function+"");
 
 
 this.append("<style class='style-bounce'>@-webkit-keyframes "+animation+" {12.5%{width: "+b_less_width[0]+"px; height: "+b_less_height[0]+"px;}25%{width: "+b_plus_width[0]+"px; height: "+b_plus_height[0]+"px;}37.5.%{width: "+b_less_width[1]+"px; height: "+b_less_height[1]+"px;}50%{width: "+b_plus_width[1]+"px; height: "+b_plus_height[1]+"px;}62.5%{width: "+b_less_width[2]+"px; height: "+b_less_height[2]+"px;}75%{width: "+b_plus_width[2]+"px; height: "+b_plus_height[2]+"px;}87.5%{width: "+b_less_width[3]+"px; height: "+b_less_height[3]+"px;}100%{width: "+b_plus_width[3]+"px; height: "+b_plus_height[3]+"px;}}</style>");
 this.css("-webkit-animation-name", ""+animation+"");
 this.css("-webkit-animation-duration", ""+options.duration+"s");
 this.css("-webkit-animation-delay", ""+options.delay+"s");
 this.css("-webkit-animation-iteration-count", ""+options.iteration_count+"");
 this.css("-webkit-animation-direction", ""+options.direction+"");
 this.css("-webkit-animation-timing-function", ""+options.timing_function+"");
 
 this.append("<style class='style-bounce'>@-moz-keyframes "+animation+" {12.5%{width: "+b_less_width[0]+"px; height: "+b_less_height[0]+"px;}25%{width: "+b_plus_width[0]+"px; height: "+b_plus_height[0]+"px;}37.5.%{width: "+b_less_width[1]+"px; height: "+b_less_height[1]+"px;}50%{width: "+b_plus_width[1]+"px; height: "+b_plus_height[1]+"px;}62.5%{width: "+b_less_width[2]+"px; height: "+b_less_height[2]+"px;}75%{width: "+b_plus_width[2]+"px; height: "+b_plus_height[2]+"px;}87.5%{width: "+b_less_width[3]+"px; height: "+b_less_height[3]+"px;}100%{width: "+b_plus_width[3]+"px; height: "+b_plus_height[3]+"px;}}</style>");
 this.css("-moz-animation-name", ""+animation+"");
 this.css("-moz-animation-duration", ""+options.duration+"s");
 this.css("-moz-animation-delay", ""+options.delay+"s");
 this.css("-moz-animation-iteration-count", ""+options.iteration_count+"");
 this.css("-moz-animation-direction", ""+options.direction+"");
 this.css("-moz-animation-timing-function", ""+options.timing_function+"");
 
};
})(jQuery);

 $(function(){
  $("#box-1").on("click", function(e){
   $("#box-1").bounce();
  });
  
  $("#box-2").on("click", function(e){
   $("#box-2").bounce({pixels: 40, duration: 1, direction: 'alternate', timing_function: 'ease-in-out'});
  });
  
  $("#box-3").on("click", function(e){
   $("#box-3").bounce({duration: 0.7, timing_function: 'cubic-bezier(30,10,30,10)'});
  });
  
  $("#img").on("mouseover", function(e){
   $("#img").bounce({pixels: 10, duration: 1, timing_function: 'ease-in-out'});
  });
 });
</script>

<style>
 #box-1{
  background-color: orange;
  width: 50px;
  height: 50px;
  border-radius: 50%;
 }
 
 #box-2{
  background-color: green;
  width: 50px;
  height: 50px;
  border-radius: 50%;
 }
 
 #box-3{
  background-color: pink;
  width: 50px;
  height: 50px;
  border-radius: 50%;
 }
</style>


</head>
<body>
<h1>jQuery bounce</h1>
<h3>Default</h3>
<div id="box-1"></div>
<h3>{pixels: 40, duration: 1, direction: 'alternate', timing_function: 'ease-in-out'}</h3>
<div id="box-2"></div>
<h3>{duration: 0.7, timing_function: 'cubic-bezier(30,10,30,10)'}</h3>
<div id="box-3"></div>
<h3>Pasa el mouse sobre la siguiente imagen ...</h3>
<img id="img" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEsomZLE4xMMymwuehFoP1YS9-lZwWcdySyJ9cDSXWBAybrBhEAJoDf8RKMn8MvSPfyfp5eGEVkgBzvKv7o2dn7_iru_BtFgossaTVa8yNU0UpjM2s9-MIFhI0aMr-MI6u7Dzyf8PROKs/s1600/jquery.png" />
</body>
</html>


miércoles, 12 de agosto de 2015

Diseño Web - Diseño del Footer con CSS3







Autor: FalconMasters

Título: Curso de Diseño Web - 8. Diseño del Footer con CSS3

Descripción:

En este curso aprenderemos a diseñar desde 0 un sitio web estático, pasando desde el diseño en Adobe Photoshop, hasta el desarrollo del sitio con HTML5 y CSS3.

♦ Blog de diseño web: http://www.falconmasters.com

♦ Necesitas ayuda con el tutorial? Únete a nuestra comunidad:
http://www.heroesdelaweb.com

---
♦ Tutorial escrito, recursos y códigos:
http://www.falconmasters.com/cursos/c...

♦ Sitio web en funcionamiento:
http://www.falconmasters.com/demos/cu...

---
Redes Sociales:

♦ Twitter @falconmasters:
http://www.twitter.com/falconmasters

♦ Pagina de Facebook:
http://www.falconmasters.com

Otras sugerencias ...

Curso de Diseño Web - 9. Añadiendo el Slideshow con SlideJS
Curso de Diseño Web - 7. Diseño del Slideshow, Contenido Principal y Sidebar con CSS3
Posicionamiento de cajas - propiedad position CSS
Como hacer un sitio web con Bootstrap 1.- Introducción y Header
Tendencias de diseño web para el 2015
Como hacer un slideshow para un sitio web con HTML, CSS y JS
Mixture, la mejor herramienta para diseñadores web
Como hacer una Barra Social (vertical y fija a pantalla) con HTML y CSS3
Como hacer un menú pegajoso / sticky menu con HTML, CSS y Javascript
Curso Básico de CSS - 13. Formularios
Como hacer botones Flat usando iconos con CSS
Curso completo de Bootstrap desde cero 1.- Introducción e Instalación
Parte 4 Footer - Mi Primera Página Web con HTML5 y Css3
Curso completo de Bootstrap 3.- Tipografía y textos
Como hacer un sitio web con Bootstrap 3.- Sidebar, Footer y Artículos Adaptables.
LECCIÓN GRATIS: Los 10 pasos del diseño web. Curso de diseño web básico
Parte 2 Slider - Mi Primera Pagina Web con HTML5 y css3
Curso de Diseño Web desde 0 - Introducción
Curso de Diseño Web - 6. Diseño de el Header con CSS3

Crear aplicaciones web con jQuery Mobile y HTML5







Autor: Ninja Code TV

Título: Curso: Desarrollo de WEB Apps con HTML5 y JQuery Mobile 1/4

Descripción:



Otras sugerencias ...

Curso: Desarrollo de WEB Apps con HTML5 y JQuery Mobile 2/4
jQuery Mobile 101
Curso diseño web video 4 (estilos css y maquetación final)
tutorial html 5 y css 3 | crear menu vertivcal con efecto hover
Menús en CSS y Javascript: Efectos
Responsive Design, Media Queries en Español - Parte 2
PHP Session 2 - Docker 101
PHP Session No.2 - Aplicaciones web con Backbone.js
Cómo subir una aplicación a Apple Store
Executando o Python a partir do prompt de comando do Windows
Desenvolvendo Aplicativos para Android em AIR- fechando pacote .APK
Tu pagina web en version movil
jQuery Mobile tutorial - 1- Hello World app !
Tips #3 - Git FTP, UnCSS y Babel
Responsive Web Design with JQuery
HTML5 Mobile Web App Created in 7 Minutes
CURSO BASICO DE HTML5 (lenguaje de programación) Parte 5 / Sitio Web en HTML5 galeria jQuery
Hola Mundo en 10 distintos Lenguajes de Programación
Geolocalizacion con PhoneGap.mp4
PHP Session No. 2 - Cloud Computing: El nuevo modelo de cómputo distribuido

martes, 11 de agosto de 2015

Crear aplicaciones móviles con HTML5, CSS3 y Javascript







Autor: Telmex Hub

Título: Aprende a crear aplicaciones móviles multiplataforma con HTML5, CSS y Javascript.

Descripción:

Será un día dedicado a conocer proyectos y herramientas creadas e impulsadas por Mozilla con la finalidad de que los asistentes aprendan a hacer web de una manera fácil y divertida con Webmaker, así como para los asistentes con un nivel intermedio, aprendan a realizar aplicaciones para móviles multiplataforma basadas en HTML5, CSS y JavaScript.

Otras sugerencias ...

DESARROLLO DE APLICACIONES MULTIPLATAFORMA (D.A.M.) | EXPLICACIÓN SOBRE EL CICLO Y OPINIÓN
Sesión 1: Freelanceando con Joombla
Creamos una App Móvil con Javascript en Directo - Framework MVC Alloy
Html básico en cómputo en la Nube
Desarrollar Aplicaciones Android con Dreamweaver CS6
APP INVENTOR: APRENDE TODO LO QUE DEBES SABER DESDE 0 | CREAR APP DESDE 0 | TUTORIAL COMPLETO
24 Aplicaciones reales hechas en Javascript
Sesión 1: Freelanceando con Joombla
Sesión 1: Agilidad para el Desarrollo de software con Scrum. (Parte 2)
Going Mobile? Aprende cómo crear aplicaciones nativas para dispositivos móviles con GeneXus
Aprende a crear la Web
Backbone.js, desarrolla aplicaciones en Javascript (Curso completo)
Desarrollo de apps móviles multiplataforma
Batalla de Código 2do día
Como Crear Apps Nativas, Android, iPhone, iPad, Html5
Desarrollo de aplicaciones móviles híbridas con framework Ionic y AngularJS
Curso: Desarrollo de WEB Apps con HTML5 y JQuery Mobile 4/4
CPCO5 - Livecode. Desarrollo ágil de aplicaciones móviles multiplataforma
VIDEO TUTORIAL CRACION WEB MOVIL HTML5 EN 1 MINUTO
Curso java avanzado 4: Clases abstractas y polimorfismo