Cómo agregar accesos directos (keyboard shortcuts) a un sitio web

   HTML y CSS, Tips Avanzados, Programación   May 3rd, 2007   Enviar por e-mail
 Votes | Average: 0 out of 4 Votes | Average: 0 out of 4 Votes | Average: 0 out of 4 Votes | Average: 0 out of 4 (No hay votos)
Loading ... Loading ...

The following javascript code will allow you to add keyboard shortcuts to any webpage.

The code

(put this on any page where you want keyboard shortcuts)

<html> <head> <script type="text/javascript" language="JavaScript" src="shortcut.js"></script> </head> <body onkeydown='keyShortcut()'> </html>

(put this in a file called shortcut.js and upload to the same directory as the webpage with the above code). This example will display an alert message when the escape key is pressed.

function keyShortcut() { var e = window.event; var code = e.keyCode; if (code == 112) { //checks for the escape key alert('escape key pressed'); }}

Vía: Justin Silverton http://www.whenpenguinsattack.com/

Suscríbete a los comentarios con RSS RSS o haz un Trackback TrackBack a 'Cómo agregar accesos directos (keyboard shortcuts) a un sitio web'.

Comenta aquí

XHTML: Puedes usa estos tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Populares


Comentarios Recientes


Artículos Anteriores


Los Temas


Archivos

Acerca del Autor

Michael Müller C. es un diseñador y desarrollador de sitios web radicado en Guayaquil, Ecuador. Creador de MMC Design en 1998 y de Iconiza en el 2007.


Del Portafolio


Lo que leo


Servicios


Contribuye

¿Te ha servido la información de este blog? Considera hacer una donación a través de:

Conoce más recomendaciones personales de libros relacionados con Diseño y Desarrollo Web en Amazon.


MMC Design | michaelmuller.net | Diseño y Desarrollo Web
Macromedia Certified Developer
MMC Design