background preloader

HTML 5

Facebook Twitter

Wolfram Hempel. Vibration API. Many of the new APIs provided to us by browser vendors are more targeted toward the mobile user than the desktop user.

Vibration API

One of those simple APIs the Vibration API. The Vibration API allows developers to direct the device, using JavaScript, to vibrate in a pattern for a given duration. Detecting Vibration API Support It's always good to check for the presence of API support before using it; here's how you can detect the Vibration API's presence: var supportsVibrate = "vibrate" in navigator; The Vibration API consists of only one method provided to the window.navigator object: vibrate.

Vibration API Basics The navigator.vibrate function accepts either a single number or an array of numbers for a series of vibrations. Navigator.vibrate(1000); navigator.vibrate([3000, 2000, 1000]); To stop vibration when active, simply pass a 0 or an empty array to the navigator.vibrate method: navigator.vibrate(0); navigator.vibrate([]); L'API de notification d'HTML 5.

HTML 5 n'est pas nouveau, tout le monde en a au moins entendu parler ; mais il y a quelques fonctionnalités qui sont encore méconnues.

L'API de notification d'HTML 5

La plupart des gens associe HTML 5 aux nouveaux tags header, footer, nav, article que vous pouvez utiliser dans vos pages mais peu connaissent les excellentes fonctionnalités disponibles pour les développeurs telles que l'API de géolocalisation ou encore la validation de formulaire. Dans ce tutoriel nous allons nous intéresser à l'API de notification. L'utilisation la plus connue de cette API est l'alerte de nouveaux e-mails sur Gmail. Si vous recevez un nouvel e-mail, une boite de dialogue s'ouvre en bas à droite de l'écran contenant le sujet et le contenu de l'e-mail. HTML5 Context Menus. Update: These context menus display even when JavaScript is disabled; so best practice will be to create these menu structures via JavaScript.

HTML5 Context Menus

Mass innerHTML injection can be used or basic DOM node injection. One of the hidden gems within the HTML5 spec is context menus. The HTML5 context menu spec allows developers to create custom context menus for given blocks within simple menu and menuitem elements. The menu information lives right within the page so there's no need to create a custom plugin. Let me show you how you can create your own custom context menus from basic HTML! Let's first start by defining a block of HTML and assigning the ID of the menu nodes to be used: With the block defined, now it's time to create the additional context menu items for the given block: With a base menu tag with the type of context and id to match the context attribute for the blog it's to be used for, menu items or submenus may be created.

Mobile HTML5 - compatibility tables for iPhone, Android, BlackBerry, Symbian, iPad and other mobile devices. HTML 5: Amazon.fr: Rodolphe Rimelé.

Form

Canvas. File API. Offline manifest & Localstorage. Websocket. Démonstration. Application. Cours/Lesson. Video/Audio. Geolocalisation, boussole. Camera. Viewport. Webmaster – Ressources et outils gratuits pour votre site internet – Free Tools. HTML5 elements in Internet Explorer without Javascript. Huh?

HTML5 elements in Internet Explorer without Javascript

Section element? I don't see no stinkin' section element. You must be mistaken, pal. What? No, I don't believe in them. John Resig drummed up a clever little solution that uses a tiny piece of Javascript to force Internet Explorer to accept those new elements: javascript: var a = ['section', 'article', 'nav', 'header', 'footer', for (var i = 0, j = a.length; i < j; i++) { document.createElement(a[i]);} Unfortunately, it doesn't work when Javascript is turned off.

And of course, after putting a new website live, the client calls up and tells you one of their "clever" system administrators has just turned off Javascript on every single workstation due to "safety concerns" and refuses to turn it back on. So you look for a different solution. Know what the DOM looks like and target other elements for styling. Yes, really good options. First, targeting other elements isn't exactly feasible. Css: And third, the noscript element is absolutely useless in this case.